Changeset 3923
- Timestamp:
- 01/25/2011 10:23:05 PM (16 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 3 edited
-
bp-core-component.php (modified) (1 diff)
-
bp-core-hooks.php (modified) (1 diff)
-
bp-core-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-component.php
r3922 r3923 220 220 } 221 221 222 222 /** 223 * Setup the component title 224 * 225 * @since Buddypress {unknown} 226 * 227 * @uses do_action() Calls 'bp_{@link bp_Component::name}_setup_title' 228 */ 223 229 function _setup_title( ) { 224 230 do_action( 'bp_' . $this->id . '_setup_title' ); 225 231 } 226 232 -
trunk/bp-core/bp-core-hooks.php
r3917 r3923 24 24 // Setup the navigation menu 25 25 add_action( 'bp_init', 'bp_setup_nav', 8 ); 26 27 // Setup the title 28 add_action( 'bp_init', 'bp_setup_title', 8 ); 26 29 27 30 // Setup widgets -
trunk/bp-core/bp-core-template.php
r3918 r3923 233 233 // A single item of a component 234 234 } elseif ( bp_is_single_item() ) { 235 $title = ucwords( $bp->current_component ) . ' | ' . $bp->bp_options_title . ' | '; //. $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'];235 $title = bp_get_name_from_root_slug() . ' | ' . $bp->bp_options_title . ' | ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name']; 236 236 237 237 // An index or directory 238 238 } elseif ( bp_is_directory() ) { 239 if ( ! $bp->current_component)240 $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( BP_MEMBERS_SLUG) );239 if ( !bp_current_component() ) 240 $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( $bp->members->slug ) ); 241 241 else 242 $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( $bp->current_component) );242 $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() ); 243 243 244 244 // Sign up page … … 621 621 } 622 622 623 /** 624 * Return the component name based on the current root slug 625 * 626 * @since BuddyPress {r3923} 627 * @global obj $bp 628 * @param str $root_slug Needle to our active component haystack 629 * @return mixed False if none found, component name if found 630 */ 631 function bp_get_name_from_root_slug( $root_slug = '' ) { 632 633 // If no slug is passed, look at current_component 634 if ( empty( $root_slug ) ) { 635 global $bp; 636 $root_slug = $bp->current_component; 637 } 638 639 // No current component or root slug, so flee 640 if ( empty( $root_slug ) ) 641 return false; 642 643 // Loop through active components and look for a match 644 foreach ( $bp->active_components as $component => $id ) 645 if ( isset( $bp->{$component}->root_slug ) && 646 !empty( $bp->{$component}->root_slug ) && 647 $bp->{$component}->root_slug == $root_slug ) 648 return $bp->{$component}->name; 649 650 return false; 651 } 652 623 653 /** is_() functions to determine the current page *****************************/ 624 654
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)