Changeset 4194
- Timestamp:
- 04/10/2011 11:49:56 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-template.php
r4192 r4194 221 221 global $bp, $post, $wp_query; 222 222 223 $title = ''; 224 223 225 // Home 224 226 if ( is_front_page() || ( is_home() && bp_is_page( 'home' ) ) ) { … … 228 230 } elseif ( bp_is_blog_page() ) { 229 231 if ( is_single() ) { 230 $title = __( 'Blog | ' . $post->post_title, 'buddypress');232 $title = sprintf( __( 'Blog | %s', 'buddypress' ), $post->post_title ); 231 233 } else if ( is_category() ) { 232 $title = __( 'Blog | Categories | ' . ucwords( $wp_query->query_vars['category_name'] ), 'buddypress');234 $title = sprintf( __( 'Blog | Categories | %s', 'buddypress' ), ucwords( $wp_query->query_vars['category_name'] ) ); 233 235 } else if ( is_tag() ) { 234 $title = __( 'Blog | Tags | ' . ucwords( $wp_query->query_vars['tag'] ), 'buddypress');236 $title = sprintf( __( 'Blog | Tags | %s', 'buddypress' ), ucwords( $wp_query->query_vars['tag'] ) ); 235 237 } else if ( is_page() ){ 236 238 $title = $post->post_title; … … 240 242 // Displayed user 241 243 } elseif ( !empty( $bp->displayed_user->fullname ) ) { 242 $title = strip_tags( $bp->displayed_user->fullname . ' | ' . ucwords( $bp->current_component ) ); 244 // translators: "displayed user's name | canonicalised component name" 245 $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->displayed_user->fullname, ucwords( bp_current_component() ) ) ); 243 246 244 247 // A single group 245 } elseif ( !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) { 246 $title = $bp->bp_options_title . ' | ' . $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name']; 248 } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) { 249 // translators: "group name | group nav section name" 250 $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] ); 247 251 248 252 // A single item from a component other than groups 249 253 } elseif ( bp_is_single_item() ) { 250 $title = bp_get_name_from_root_slug() . ' | ' . $bp->bp_options_title . ' | ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name']; 254 // translators: "root component name | component item name | component nav section name" 255 $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), bp_get_name_from_root_slug(), $bp->bp_options_title, $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] ); 251 256 252 257 // An index or directory 253 258 } elseif ( bp_is_directory() ) { 254 259 if ( !bp_current_component() ) 255 $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( $bp->members->slug ) );260 $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug( $bp->members->slug ) ); 256 261 else 257 262 $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() ); … … 655 660 * 656 661 * @since BuddyPress {r3923} 657 * @global obj $bp662 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 658 663 * @param str $root_slug Needle to our active component haystack 659 664 * @return mixed False if none found, component name if found 660 665 */ 661 666 function bp_get_name_from_root_slug( $root_slug = '' ) { 667 global $bp; 662 668 663 669 // If no slug is passed, look at current_component 664 if ( empty( $root_slug ) ) { 665 global $bp; 670 if ( empty( $root_slug ) ) 666 671 $root_slug = $bp->current_component; 667 }668 672 669 673 // No current component or root slug, so flee
Note: See TracChangeset
for help on using the changeset viewer.