本文整理汇总了PHP中TimberURLHelper::get_host方法的典型用法代码示例。如果您正苦于以下问题:PHP TimberURLHelper::get_host方法的具体用法?PHP TimberURLHelper::get_host怎么用?PHP TimberURLHelper::get_host使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimberURLHelper
的用法示例。
在下文中一共展示了TimberURLHelper::get_host方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_context
/**
* Get context.
*
* @return array
*/
public static function get_context()
{
$data = array();
$data['http_host'] = 'http://' . TimberURLHelper::get_host();
$data['wp_title'] = TimberHelper::get_wp_title();
$data['wp_head'] = TimberHelper::function_wrapper('wp_head');
$data['wp_footer'] = TimberHelper::function_wrapper('wp_footer');
$data['body_class'] = implode(' ', get_body_class());
$data['site'] = new TimberSite();
$data['theme'] = $data['site']->theme;
//deprecated, these should be fetched via TimberSite or TimberTheme
$data['theme_dir'] = WP_CONTENT_SUBDIR . str_replace(WP_CONTENT_DIR, '', get_stylesheet_directory());
$data['language_attributes'] = TimberHelper::function_wrapper('language_attributes');
$data['stylesheet_uri'] = get_stylesheet_uri();
$data['template_uri'] = get_template_directory_uri();
$data['posts'] = Timber::query_posts();
//deprecated, this should be fetched via TimberMenu
if (function_exists('wp_nav_menu')) {
$locations = get_nav_menu_locations();
if (count($locations)) {
$data['wp_nav_menu'] = wp_nav_menu(array('container_class' => 'menu-header', 'echo' => false, 'menu_class' => 'nav-menu'));
}
}
$data = apply_filters('timber_context', $data);
$data = apply_filters('timber/context', $data);
return $data;
}
示例2: get_context
/**
* Get context.
*
* @return array
*/
public static function get_context()
{
$data = array();
$data['http_host'] = 'http://' . TimberURLHelper::get_host();
$data['wp_title'] = TimberHelper::get_wp_title();
$data['wp_head'] = TimberHelper::function_wrapper('wp_head');
$data['wp_footer'] = TimberHelper::function_wrapper('wp_footer');
$data['body_class'] = implode(' ', get_body_class());
$data['site'] = new TimberSite();
$data['theme'] = $data['site']->theme;
$data['posts'] = Timber::query_posts();
$data = apply_filters('timber_context', $data);
$data = apply_filters('timber/context', $data);
return $data;
}