本文整理匯總了PHP中EEH_Template::is_espresso_theme方法的典型用法代碼示例。如果您正苦於以下問題:PHP EEH_Template::is_espresso_theme方法的具體用法?PHP EEH_Template::is_espresso_theme怎麽用?PHP EEH_Template::is_espresso_theme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EEH_Template
的用法示例。
在下文中一共展示了EEH_Template::is_espresso_theme方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: template_include
/**
* template_include
*
* @access public
* @param string $template
* @return string
*/
public function template_include($template = '')
{
// don't add content filter for dedicated EE child themes or private posts
EE_Registry::instance()->load_helper('Template');
if (!EEH_Template::is_espresso_theme()) {
/** @type EE_Events_Archive_Config $config */
$config = $this->config();
// add status banner ?
if ($config->display_status_banner) {
add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2);
}
// if NOT a custom template
if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' || apply_filters('FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE)) {
// don't display entry meta because the existing theme will take care of that
add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true');
// load functions.php file for the theme (loaded by WP if using child theme)
EEH_Template::load_espresso_theme_functions();
// because we don't know if the theme is using the_excerpt()
add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1);
// or the_content
add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1);
// and just in case they are running get_the_excerpt() which DESTROYS things
add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1);
// don't display entry meta because the existing theme will take care of that
add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
}
}
return $template;
}
示例2: template_include
/**
* template_include
*
* @access public
* @param string $template
* @return string
*/
public function template_include($template = '')
{
// ensure valid EE_Events_Archive_Config() object exists
// EED_Events_Archive::_set_config();
// don't add content filter for dedicated EE child themes or private posts
if (!EEH_Template::is_espresso_theme() && !post_password_required()) {
// add status banner ?
if ($this->config()->display_status_banner) {
add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2);
}
// if NOT a custom template
if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') {
// load functions.php file for the theme (loaded by WP if using child theme)
EEH_Template::load_espresso_theme_functions();
// because we don't know if the theme is using the_excerpt()
add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1);
// or the_content
add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1);
// and just in case they are running get_the_excerpt() which DESTROYS things
add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1);
// don't display entry meta because the existing theme will take care of that
add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
}
}
return $template;
}