Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2014 09:11:24 PM (11 years ago)
Author:
r-a-y
Message:

BP Nav Menu: If menu URL doesn't exist, mark menu item as invalid.

Previously, when a BuddyPress component is deactivated but a menu item
for this component still exists, the generated menu would create a warning.

This commit addresses this.

Fixes #5545 (trunk)

File:
1 edited

Legend:

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

    r8137 r8308  
    538538    }
    539539
     540    // If component is deactivated, make sure menu item doesn't render
     541    if ( empty( $menu_item->url ) ) {
     542        $menu_item->_invalid = true;
     543
    540544    // Highlight the current page
    541     $current = bp_get_requested_url();
    542     if ( strpos( $current, $menu_item->url ) !== false ) {
    543         $menu_item->classes[] = 'current_page_item';
     545    } else {
     546        $current = bp_get_requested_url();
     547        if ( strpos( $current, $menu_item->url ) !== false ) {
     548            $menu_item->classes[] = 'current_page_item';
     549        }
    544550    }
    545551
Note: See TracChangeset for help on using the changeset viewer.