/**
* Get context.
* @api
* @return array
*/
public static function get_context()
{
if (empty(self::$context_cache)) {
self::$context_cache['http_host'] = URLHelper::get_scheme() . '://' . URLHelper::get_host();
self::$context_cache['wp_title'] = Helper::get_wp_title();
self::$context_cache['wp_head'] = Helper::function_wrapper('wp_head');
self::$context_cache['wp_footer'] = Helper::function_wrapper('wp_footer');
self::$context_cache['body_class'] = implode(' ', get_body_class());
self::$context_cache['site'] = new Site();
self::$context_cache['request'] = new Request();
$user = new User();
self::$context_cache['user'] = $user->ID ? $user : false;
self::$context_cache['theme'] = self::$context_cache['site']->theme;
//Not yet! but this will soon be the default...
//self::$context_cache['posts'] = new PostQuery();
self::$context_cache['posts'] = Timber::query_posts();
self::$context_cache = apply_filters('timber_context', self::$context_cache);
self::$context_cache = apply_filters('timber/context', self::$context_cache);
}
return self::$context_cache;
}