Skip to:
Content

BuddyPress.org

Changeset 9104


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

Core: Page title: code standards improvements.

See #5838

File:
1 edited

Legend:

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

    r9103 r9104  
    428428
    429429        // If this is not a BP page, just return the title produced by WP
    430         if ( bp_is_blog_page() )
     430        if ( bp_is_blog_page() ) {
    431431                return $title;
     432        }
    432433
    433434        // If this is a 404, let WordPress handle it
     
    437438
    438439        // If this is the front page of the site, return WP's title
    439         if ( is_front_page() || is_home() )
     440        if ( is_front_page() || is_home() ) {
    440441                return $title;
     442        }
    441443
    442444        $title = '';
    443445
    444446        // Displayed user
    445         if ( bp_get_displayed_user_fullname() && !is_404() ) {
     447        if ( bp_get_displayed_user_fullname() && ! is_404() ) {
    446448
    447449                // Get the component's ID to try and get it's name
     
    449451
    450452                // Use the actual component name
    451                 if ( !empty( $bp->{$component_id}->name ) ) {
     453                if ( ! empty( $bp->{$component_id}->name ) ) {
    452454                        $component_name = $bp->{$component_id}->name;
    453455
    454456                // Fall back on the component ID (probably same as current_component)
    455                 } elseif ( !empty( $bp->{$component_id}->id ) ) {
     457                } elseif ( ! empty( $bp->{$component_id}->id ) ) {
    456458                        $component_name = $bp->{$component_id}->id;
    457459                }
     
    461463
    462464        // A single group
    463         } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
    464                 $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'] : '';
     465        } elseif ( bp_is_active( 'groups' ) && ! empty( $bp->groups->current_group ) && ! empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
     466                $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'] : '';
    465467                // translators: "group name | group nav section name"
    466468                $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );
     
    469471        } elseif ( bp_is_single_item() ) {
    470472                // translators: "component item name | component nav section name | root component name"
    471                 $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() ) );
     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() ) );
    472474
    473475        // An index or directory
Note: See TracChangeset for help on using the changeset viewer.