本文整理匯總了PHP中TemplateManager::override_templates方法的典型用法代碼示例。如果您正苦於以下問題:PHP TemplateManager::override_templates方法的具體用法?PHP TemplateManager::override_templates怎麽用?PHP TemplateManager::override_templates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TemplateManager
的用法示例。
在下文中一共展示了TemplateManager::override_templates方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Plugin
$GLOBALS['wpkb'] = $wpkb = new Plugin(WPKB_VERSION, __FILE__, __DIR__);
$wpkb->add_hooks();
// load breadcrumbs
$breadcrumbs = new Breadcrumbs\Manager($wpkb->get_option('custom_archive_page_id'));
$breadcrumbs->add_hooks();
$wpkb->attach($breadcrumbs, 'breadcrumbs');
// load search
$search = new Search($wpkb);
$search->add_hooks();
$wpkb->attach($search, 'search');
// load code highlighter
$highlighting = new CodeHighlighting($wpkb);
$highlighting->add_hooks();
// load callouts
$callouts = new Callouts();
$callouts->add_hooks();
// rating
$rating = new Rating\Rater();
$rating->add_hooks();
$wpkb->attach($rating, 'rating');
if (is_admin()) {
$rating_admin = new Rating\Admin();
$rating_admin->add_hooks();
}
// load template manager
add_action('template_redirect', function () use($wpkb) {
$template = new TemplateManager($wpkb);
$template->override_templates();
});
// Register [wpkb_list] shortcode
ArticleList::register_shortcode();