Changeset 7171
- Timestamp:
- 06/06/2013 11:13:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-buddybar.php
r6762 r7171 82 82 unset( $bp->canonical_stack['action'] ); 83 83 } elseif ( ! bp_current_action() ) { 84 $func = is_object( $screen_function[0] ) ? array( &$screen_function[0], $screen_function[1] ) : $screen_function; 85 add_action( 'bp_screens', $func, 3 ); 84 85 // Add our screen hook if screen function is callable 86 if ( is_callable( $screen_function ) ) { 87 add_action( 'bp_screens', $screen_function, 3 ); 88 } 86 89 87 90 if ( !empty( $default_subnav_slug ) ) { … … 113 116 114 117 if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) { 115 if ( is_object( $function[0] ) ) { 116 remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 ); 117 } else { 118 // Remove our screen hook if screen function is callable 119 if ( is_callable( $function ) ) { 118 120 remove_action( 'bp_screens', $function, 3 ); 119 121 } … … 137 139 if ( empty( $unfiltered_action ) ) { 138 140 if ( !bp_is_current_action( $subnav_slug ) ) { 139 if ( is_object( $screen_function[0] ) ) { 140 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 ); 141 } else { 141 if ( is_callable( $screen_function ) ) { 142 142 add_action( 'bp_screens', $screen_function, 3 ); 143 143 } … … 279 279 // Before hooking the screen function, check user access 280 280 if ( !empty( $user_has_access ) ) { 281 if ( is_object( $screen_function[0] ) ) { 282 add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 ); 283 } else { 281 // Add our screen hook if screen function is callable 282 if ( is_callable( $screen_function ) ) { 284 283 add_action( 'bp_screens', $screen_function, 3 ); 285 284 } … … 391 390 392 391 if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) { 393 if ( is_object( $function[0] ) ) { 394 remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 ); 395 } else { 392 // Remove our screen hook if screen function is callable 393 if ( is_callable( $function ) ) { 396 394 remove_action( 'bp_screens', $function, 3 ); 397 395 } … … 413 411 $screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] : false; 414 412 415 if ( !empty( $screen_function ) ) { 416 if ( is_object( $screen_function[0] ) ) { 417 remove_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 ); 418 } else { 413 if ( ! empty( $screen_function ) ) { 414 // Remove our screen hook if screen function is callable 415 if ( is_callable( $screen_function ) ) { 419 416 remove_action( 'bp_screens', $screen_function, 3 ); 420 417 }
Note: See TracChangeset
for help on using the changeset viewer.