Changeset 9471 for trunk/src/bp-core/bp-core-buddybar.php
- Timestamp:
- 02/10/2015 02:49:16 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-buddybar.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-buddybar.php
r9351 r9471 14 14 /** 15 15 * Add an item to the main BuddyPress navigation array. 16 *17 * @global BuddyPress $bp The one true BuddyPress instance.18 16 * 19 17 * @param array $args { … … 39 37 */ 40 38 function bp_core_new_nav_item( $args = '' ) { 41 global $bp;39 $bp = buddypress(); 42 40 43 41 $defaults = array( … … 120 118 * Modify the default subnav item that loads when a top level nav item is clicked. 121 119 * 122 * @global BuddyPress $bp The one true BuddyPress instance.123 *124 120 * @param array $args { 125 121 * @type string $parent_slug The slug of the nav item whose default is … … 131 127 */ 132 128 function bp_core_new_nav_default( $args = '' ) { 133 global $bp;129 $bp = buddypress(); 134 130 135 131 $defaults = array( … … 196 192 * after all plugins have had a chance to register their navigation items. 197 193 * 198 * @global BuddyPress $bp The one true BuddyPress instance199 *200 194 * @return bool|null Returns false on failure. 201 195 */ 202 196 function bp_core_sort_nav_items() { 203 global $bp;197 $bp = buddypress(); 204 198 205 199 if ( empty( $bp->bp_nav ) || !is_array( $bp->bp_nav ) ) … … 229 223 /** 230 224 * Add a subnav item to the BuddyPress navigation. 231 *232 * @global BuddyPress $bp The one true BuddyPress instance.233 225 * 234 226 * @param array $args { … … 261 253 */ 262 254 function bp_core_new_subnav_item( $args = '' ) { 263 global $bp;255 $bp = buddypress(); 264 256 265 257 $r = wp_parse_args( $args, array( … … 442 434 * Sort all subnavigation arrays. 443 435 * 444 * @global BuddyPress $bp The one true BuddyPress instance445 *446 436 * @return bool|null Returns false on failure. 447 437 */ 448 438 function bp_core_sort_subnav_items() { 449 global $bp;439 $bp = buddypress(); 450 440 451 441 if ( empty( $bp->bp_options_nav ) || !is_array( $bp->bp_options_nav ) ) … … 487 477 */ 488 478 function bp_nav_item_has_subnav( $nav_item = '' ) { 489 global $bp;479 $bp = buddypress(); 490 480 491 481 if ( !$nav_item ) … … 504 494 */ 505 495 function bp_core_remove_nav_item( $parent_id ) { 506 global $bp;496 $bp = buddypress(); 507 497 508 498 // Unset subnav items for this nav item … … 533 523 */ 534 524 function bp_core_remove_subnav_item( $parent_id, $slug ) { 535 global $bp; 536 537 $screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] : false; 525 $bp = buddypress(); 526 527 $screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) 528 ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] 529 : false; 538 530 539 531 if ( ! empty( $screen_function ) ) { … … 553 545 * Clear all subnav items from a specific nav item. 554 546 * 555 * @global BuddyPress $bp The one true BuddyPress instance.556 *557 547 * @param string $parent_slug The slug of the parent navigation item. 558 548 */ 559 549 function bp_core_reset_subnav_items( $parent_slug ) { 560 global $bp;550 $bp = buddypress(); 561 551 562 552 unset( $bp->bp_options_nav[$parent_slug] );
Note: See TracChangeset
for help on using the changeset viewer.