Skip to:
Content

BuddyPress.org

Changeset 1767


Ignore:
Timestamp:
09/02/2009 09:52:40 PM (15 years ago)
Author:
apeatling
Message:

Fixes #890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1762 r1767  
    534534 * bp_core_remove_nav_item()
    535535 *
    536  * Removes a navigation item from the navigation array used in BuddyPress themes.
    537  *
    538  * @package BuddyPress Core
    539  * @param $parent_id The id of the parent navigation item.
     536 * Removes a navigation item from the main navigation array.
     537 *
     538 * @package BuddyPress Core
    540539 * @param $slug The slug of the sub navigation item.
    541540 */
    542 function bp_core_remove_nav_item( $name ) {
    543     global $bp;
    544 
    545     foreach( (array) $bp->bp_nav as $item_key => $item_value ) {
    546         if ( $item_value['name'] == $name ) {
    547             unset( $bp->bp_nav[$item_key] );
    548         }
    549     }
    550    
    551     foreach( (array) $bp->bp_users_nav as $item_key => $item_value ) {
    552         if ( $item_value['name'] == $name ) {
    553             unset( $bp->bp_nav[$item_key] );
    554         }
    555     }
     541function bp_core_remove_nav_item( $slug ) {
     542    global $bp;
     543
     544    unset( $bp->bp_nav[$slug] );
    556545}
    557546
Note: See TracChangeset for help on using the changeset viewer.