Making WordPress.org


Ignore:
Timestamp:
06/09/2018 04:12:50 AM (8 years ago)
Author:
obenland
Message:

Support: Continue using wp_title for bbpress

It seems like titles for bbpress views don't work well with wp_get_document_title().

See [7288], #3539.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r7288 r7289  
    137137 */
    138138function wporg_get_global_header() {
    139     $GLOBALS['pagetitle'] = wp_get_document_title();
     139    $GLOBALS['pagetitle'] = wp_title( '|', false, 'right' ) . ' ' . __( 'WordPress.org', 'wporg-forums' );
    140140    require WPORGPATH . 'header.php';
    141141}
     
    150150}
    151151
    152 
    153152/**
    154153 * Append an optimized site name.
    155154 *
    156  * @param array $title {
    157  *     The document title parts.
    158  *
    159  *     @type string $title   Title of the viewed page.
    160  *     @type string $page    Optional. Page number if paginated.
    161  *     @type string $tagline Optional. Site description when on home page.
    162  *     @type string $site    Optional. Site title when not on home page.
    163  * }
     155 * @param array $title Parts of the page title.
    164156 * @return array Filtered title parts.
    165157 */
    166158function wporg_support_document_title( $title ) {
    167159    if ( is_front_page() ) {
    168         $title['title']   = _x( 'Support', 'Site title', 'wporg-forums' );
    169         $title['tagline'] = __( 'WordPress.org', 'wporg-forums' );
    170     } else {
    171         $title['site'] = __( 'WordPress.org', 'wporg-forums' );
     160        $title[1] = _x( 'Support', 'Site title', 'wporg-forums' );
    172161    }
    173162
    174163    return $title;
    175164}
    176 add_filter( 'document_title_parts', 'wporg_support_document_title' );
    177 
    178 /**
    179  * Set the separator for the document title.
    180  *
    181  * @return string Document title separator.
    182  */
    183 function wporg_support_document_title_separator() {
    184     return '|';
    185 }
    186 add_filter( 'document_title_separator', 'wporg_support_document_title_separator' );
     165add_filter( 'wp_title_parts', 'wporg_support_document_title' );
    187166
    188167/**
Note: See TracChangeset for help on using the changeset viewer.