WordPress.org

Making WordPress.org

Ticket #1353: 1353.wporg-forums.diff

File 1353.wporg-forums.diff, 1.3 KB (added by coffee2code, 4 years ago)

Patch to update wporg-forums. (see comment #11 for context.

  • wporg-forums/functions.php

     
    121121 * @package WPBBP
    122122 */
    123123function wporg_get_global_header() {
    124         $GLOBALS['pagetitle'] = wp_title( '«', false, 'right' ) . ' ' . get_bloginfo( 'name' );
     124        $GLOBALS['pagetitle'] = wp_get_document_title();
    125125        require WPORGPATH . 'header.php';
    126126}
    127127
     128
    128129/**
     130 * Customize document title.
     131 *
     132 * @param array  $parts The document title parts.
     133 * @return array The document title parts.
     134 */
     135function wporg_remove_forum_name_from_title( $parts ) {
     136        // Omit page name from the home page.
     137        if ( is_front_page() ) {
     138                $parts['title'] = '';
     139        }
     140
     141        // Run the title through bbPress's title customizer.
     142        // TODO: Remove this once bbPress deprecates hooking wp_title and hooks
     143        // 'document_title_parts' instead.
     144        $parts['title'] = bbp_title( $parts['title'], '', 'right' );
     145
     146        return $parts;
     147}
     148add_filter( 'document_title_parts', 'wporg_remove_forum_name_from_title' );
     149
     150// Change the document title separator.
     151add_filter( 'document_title_separator', create_function( '$separator', 'return "«";' ) );
     152
     153/**
    129154 * The Footer for our theme.
    130155 *
    131156 * @package WPBBP