public function add_to_context($context) { $context = parent::add_to_context($context); return $context; }
public function add_to_context($context) { // Theme Options/Settings - prevent to run twice if child-themed if (!isset($context['theme_options'])) { $context['theme_options'] = new TimberFoundation_ThemeOptions(); } $context = parent::add_to_context($context); // Override the title and force the seperator on the right $context['wp_title'] = TimberHelper::get_wp_title('»', 'right'); // Menu $context = $this->add_menus_to_context($context); // WP API $context['dynamic_sidebar'] = TimberHelper::function_wrapper('dynamic_sidebar', array(), true); $context['is_user_logged_in'] = is_user_logged_in(); $context['current_user'] = is_user_logged_in() ? new TimberUser() : false; $context['wp_login_url'] = TimberHelper::function_wrapper('wp_login_url', array(get_permalink())); $context['wp_logout_url'] = TimberHelper::function_wrapper('wp_logout_url', array(get_permalink())); global $comment_author, $comment_author_email, $comment_author_url; $context['comment_author'] = $comment_author; $context['comment_author_email'] = $comment_author_email; $context['comment_author_url'] = $comment_author_url; return $context; }