Skip to:
Content

BuddyPress.org

Ticket #6765: 6765-01.patch

File 6765-01.patch, 1.0 KB (added by hnla, 9 years ago)

Initial patch as proof of concept only. Adds a new primary check on bp_core_get_directory_pages() before setup globals string check.

  • src/bp-core/bp-core-template.php

     
    120120function bp_get_directory_title( $component = '' ) {
    121121        $title = '';
    122122
    123         // Use the string provided by the component.
    124         if ( ! empty( buddypress()->{$component}->directory_title ) ) {
     123        /*
     124        * Use the 'title' string set in bp_core_get_directory_pages() &
     125        * built from either wp_get_cache('directory_pages', 'bp') or from a wbdb post query
     126        * This allows us to print the WP Page name as set or changed by the user.
     127        */
     128        if ( ! empty( bp_core_get_directory_pages()->{$component}->title ) ) {
     129                $title = bp_core_get_directory_pages()->{$component}->title;
     130
     131        // Or use the string provided by the component in bp-{component}-loader.php setup_globals.
     132        } elseif ( ! empty( buddypress()->{$component}->directory_title ) ) {
    125133                $title = buddypress()->{$component}->directory_title;
    126134
    127135        // If none is found, concatenate.