Changeset 5758 for trunk/bp-core/bp-core-buddybar.php
- Timestamp:
- 02/13/2012 05:46:52 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-buddybar.php
r5751 r5758 125 125 } 126 126 127 if ( $bp->current_component == $parent_slug && !$bp->current_action) {128 if ( !is_object( $screen_function[0] ) ) 127 if ( bp_is_current_component( $parent_slug ) && !bp_current_action() ) { 128 if ( !is_object( $screen_function[0] ) ) { 129 129 add_action( 'bp_screens', $screen_function ); 130 else130 } else { 131 131 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) ); 132 } 132 133 133 134 if ( $subnav_slug ) { … … 237 238 238 239 // If we *don't* meet condition (1), return 239 if ( $bp->current_component != $parent_slug && $bp->current_item != $parent_slug)240 if ( ! bp_is_current_component( $parent_slug ) && ! bp_is_current_item( $parent_slug ) ) 240 241 return; 241 242 242 243 // If we *do* meet condition (2), then the added subnav item is currently being requested 243 if ( ( !empty( $bp->current_action ) && $slug == $bp->current_action ) || ( bp_is_user() && empty( $bp->current_action ) && $screen_function == $bp->bp_nav[$parent_slug]['screen_function']) ) {244 if ( ( bp_current_action() && bp_is_current_action( $slug ) ) || ( bp_is_user() && ! bp_current_action() && ( $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) ) { 244 245 245 246 // Before hooking the screen function, check user access 246 if ( $user_has_access) {247 if ( !is_object( $screen_function[0] ) ) 247 if ( !empty( $user_has_access ) ) { 248 if ( !is_object( $screen_function[0] ) ) { 248 249 add_action( 'bp_screens', $screen_function ); 249 else250 } else { 250 251 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) ); 252 } 251 253 } else { 252 254 // When the content is off-limits, we handle the situation differently
Note: See TracChangeset
for help on using the changeset viewer.