Skip to:
Content

BuddyPress.org

Changeset 9105


Ignore:
Timestamp:
10/29/2014 07:39:19 PM (12 years ago)
Author:
djpaul
Message:

Core: Page title: remove component name from members component item pages. Additional screens introduced by other plugins have been similarily changes.

This simplifies the <title> for the member profile screens; the longer the title, the less likely it will fit in the narrow space afforded by modern web browsers. I expect most people will only have one tab open for a one member (for example); it's an edge case to have multiple tabs open on different parts of the same user's profile for most/general use.

See #5838, props sooskriszta for the initial patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-filters.php

    r9104 r9105  
    446446        // Displayed user
    447447        if ( bp_get_displayed_user_fullname() && ! is_404() ) {
    448 
    449                 // Get the component's ID to try and get it's name
    450                 $component_id = $component_name = bp_current_component();
    451 
    452                 // Use the actual component name
    453                 if ( ! empty( $bp->{$component_id}->name ) ) {
    454                         $component_name = $bp->{$component_id}->name;
    455 
    456                 // Fall back on the component ID (probably same as current_component)
    457                 } elseif ( ! empty( $bp->{$component_id}->id ) ) {
    458                         $component_name = $bp->{$component_id}->id;
    459                 }
    460 
    461                 // translators: construct the page title. 1 = user name, 2 = component name, 3 = seperator
    462                 $title = strip_tags( sprintf( __( '%1$s %3$s %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) );
     448                $title = bp_get_displayed_user_fullname();
    463449
    464450        // A single group
    465         } elseif ( bp_is_active( 'groups' ) && ! empty( $bp->groups->current_group ) && ! empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
     451        } elseif ( bp_is_active( 'groups' ) && ! empty( $bp->groups->current_group ) && ! empty( $bp->bp_options_nav[ $bp->groups->current_group->slug ] ) ) {
    466452                $subnav = isset( $bp->bp_options_nav[ $bp->groups->current_group->slug ][ bp_current_action() ]['name'] ) ? $bp->bp_options_nav[ $bp->groups->current_group->slug ][ bp_current_action() ]['name'] : '';
    467453                // translators: "group name | group nav section name"
     
    470456        // A single item from a component other than groups
    471457        } elseif ( bp_is_single_item() ) {
    472                 // translators: "component item name | component nav section name | root component name"
    473                 $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[ bp_current_item() ][ bp_current_action() ]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
     458                // translators: "component item name | component nav section name"
     459                $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[ bp_current_item() ][ bp_current_action() ]['name'] );
    474460
    475461        // An index or directory
    476462        } elseif ( bp_is_directory() ) {
    477 
    478463                $current_component = bp_current_component();
    479464
Note: See TracChangeset for help on using the changeset viewer.