Exemplo n.º 1
0
            $output = false;
            if ($cache) {
                $group = '_CRED_';
                $key = md5(serialize(array($template_path, $args)));
                $output = wp_cache_get($key, $group);
            }
            if (false === $output) {
                if (!is_file($template_path)) {
                    printf('File "%s" doesn\'t exist!', $template_path);
                    return '';
                }
                $output = self::getTpl($template_path, $args);
                if ($cache) {
                    wp_cache_set($key, $output, $group);
                }
            }
            return $output;
        }
        private static function getTpl($______templatepath________, array $______args______ = array())
        {
            ob_start();
            if (!empty($______args______)) {
                extract($______args______);
            }
            include $______templatepath________;
            return ob_get_clean();
        }
    }
    // init on load
    CREDC_Loader::init();
}