Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/10/2016 02:25:50 PM (8 years ago)
Author:
hnla
Message:

Use WP page titles for BP directory pages headings

The activity directory heading historically used a hardcoded string for it's WP page title (post_title), with other component directories taking the name from the actual WP page title.

This commit brings all page headings for BP directories into parity, screens will look to the WP page(post_title) for the string to use, & BP sets a new series of initial default strings for new installs page creation.

An update routine is provided to ensure that no existing sites will suddenly see a new title string, if a previous install then update the post_title to older hardcoded strings (unless the page title changed by user), thereafter changes to the WP page title determine what BP will display.

Props boonebgorges, imath, dcavins, hnla
Fixes #6765

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r10794 r11080  
    169169        );
    170170
     171        // Fetch the default directory title.
     172        $default_directory_titles = bp_core_get_directory_page_default_titles();
     173        $default_directory_title  = $default_directory_titles[$this->id];
     174
    171175        // All globals for groups component.
    172176        // Note that global_tables is included in this array.
     
    175179            'root_slug'             => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG,
    176180            'has_directory'         => true,
    177             'directory_title'       => _x( 'Groups', 'component directory title', 'buddypress' ),
     181            'directory_title'       => isset( $bp->pages->groups->title ) ? $bp->pages->groups->title : $default_directory_title,
    178182            'notification_callback' => 'groups_format_notifications',
    179183            'search_string'         => _x( 'Search Groups...', 'Component directory search', 'buddypress' ),
Note: See TracChangeset for help on using the changeset viewer.