Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/10/2016 02:25:50 PM (3 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-blogs/classes/class-bp-blogs-component.php

    r10674 r11080  
    77 * information from those blogs to make querying blogs in bulk more performant.
    88 *
    9  * @package BuddyPress
     9    * @package BuddyPress
    1010 * @subpackage BlogsCore
    1111 * @since 1.5.0
     
    4545     * @since 1.5.0
    4646     *
    47      * @see BP_Component::setup_globals() for description of parameters.
     47        * @see BP_Component::setup_globals() for description of parameters.
    4848     *
    4949     * @param array $args See {@link BP_Component::setup_globals()}.
     
    6565            'blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta',
    6666        );
     67
     68        // Fetch the default directory title.
     69        $default_directory_titles = bp_core_get_directory_page_default_titles();
     70        $default_directory_title  = $default_directory_titles[$this->id];
    6771
    6872        // All globals for blogs component.
     
    7175            'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
    7276            'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site.
    73             'directory_title'       => _x( 'Sites', 'component directory title', 'buddypress' ),
     77            'directory_title'       => isset( $bp->pages->blogs->title ) ? $bp->pages->blogs->title : $default_directory_title,
    7478            'notification_callback' => 'bp_blogs_format_notifications',
    7579            'search_string'         => __( 'Search sites...', 'buddypress' ),
     
    151155     * @param array $main_nav Optional. See BP_Component::setup_nav() for
    152156     *                        description.
    153      * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
     157        * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
    154158     *                        description.
    155159     */
Note: See TracChangeset for help on using the changeset viewer.