Exemplo n.º 1
0
 /**
  * Displays the title.  Parses the variables.
  **/
 public static function output_title($title, $forced_title = null)
 {
     if (is_feed()) {
         return null;
     }
     if (self::plugin_active()) {
         return $title;
     }
     $seo_templates_query = HeadwayOption::get('seo-templates', 'general', self::output_layouts_and_defaults());
     $seo_templates = headway_get(HeadwaySEO::current_seo_layout(), $seo_templates_query, array());
     if (HeadwayLayoutOption::get(false, 'title', 'seo', false)) {
         $title = HeadwayLayoutOption::get(false, 'title', 'seo', false);
     } elseif (headway_get('title', $seo_templates)) {
         $title = headway_get('title', $seo_templates);
     }
     /* If the template is %tagline% | %sitename% and there is no tagline, then remove the tagline and pipe character */
     if ($title === '%tagline% | %sitename%' && get_bloginfo('description') == false) {
         $title = '%sitename%';
     }
     /* Allow $forced_page_name to change %title%... Useful for plugins like BuddyPress */
     if ($forced_title) {
         $title = str_ireplace('%title%', $forced_title, $title);
     }
     return HeadwaySEO::parse_seo_variables($title);
 }