diff --git bp-core/bp-core-buddybar.php bp-core/bp-core-buddybar.php
index 48c0a8d..feed53e 100644
|
|
|
function bp_core_remove_nav_item( $parent_id ) { |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | unset( $bp->bp_nav[$parent_id] ); |
| | 351 | |
| | 352 | if ( bp_use_wp_admin_bar() ) { |
| | 353 | $bp->remove_from_admin_bar[$parent_id]['self'] = true; |
| | 354 | } |
| 351 | 355 | } |
| 352 | 356 | |
| | 357 | function bp_core_remove_nav_item_from_admin_bar_helper() { |
| | 358 | global $bp, $wp_admin_bar; |
| | 359 | |
| | 360 | if ( !empty( $bp->remove_from_admin_bar ) ) { |
| | 361 | foreach( (array)$bp->remove_from_admin_bar as $slug => $item ) { |
| | 362 | foreach( (array)$item as $key => $nav_item ) { |
| | 363 | if ( 'self' == $key ) { |
| | 364 | $wp_admin_bar->remove_menu( 'my-account-' . $slug ); |
| | 365 | } else { |
| | 366 | $wp_admin_bar->remove_menu( 'my-account-' . $slug . '-' . $nav_item ); |
| | 367 | } |
| | 368 | } |
| | 369 | } |
| | 370 | } |
| | 371 | } |
| | 372 | add_action( 'wp_before_admin_bar_render', 'bp_core_remove_nav_item_from_admin_bar_helper' ); |
| | 373 | |
| 353 | 374 | /** |
| 354 | 375 | * Removes a navigation item from the sub navigation array used in BuddyPress themes. |
| 355 | 376 | * |
| … |
… |
function bp_core_remove_subnav_item( $parent_id, $slug ) { |
| 373 | 394 | |
| 374 | 395 | if ( isset( $bp->bp_options_nav[$parent_id] ) && !count( $bp->bp_options_nav[$parent_id] ) ) |
| 375 | 396 | unset($bp->bp_options_nav[$parent_id]); |
| | 397 | |
| | 398 | if ( bp_use_wp_admin_bar() ) { |
| | 399 | $bp->remove_from_admin_bar[$parent_id][$slug] = $slug; |
| | 400 | } |
| 376 | 401 | } |
| 377 | 402 | |
| 378 | 403 | /** |