Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/15/2012 07:39:54 PM (12 years ago)
Author:
boonebgorges
Message:

Fixes PHP warning when attempting to remove nav item that doesn't exist

Fixes #4533

Props wpdennis, jkudish

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-buddybar.php

    r6342 r6412  
    374374 *
    375375 * @package BuddyPress Core
    376  * @param $parent_id The id of the parent navigation item.
    377  * @param $slug The slug of the sub navigation item.
     376 * @param int $parent_id The id of the parent navigation item.
     377 * @param bool|string false if the parent item doesn't exist or $slug the slug of the sub navigation item.
    378378 */
    379379function bp_core_remove_nav_item( $parent_id ) {
     
    386386        }
    387387    }
     388
     389    if ( empty( $bp->bp_nav[ $parent_id ] ) )
     390        return false;
    388391
    389392    if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) {
Note: See TracChangeset for help on using the changeset viewer.