Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/20/2018 09:39:27 PM (7 years ago)
Author:
r-a-y
Message:

Navigation: Restricted subnav menu pages should redirect instead of throwing a 404.

Back in BuddyPress 2.6.0, we refactored the way we register menu items with
the BP Navigation API (see #6534).

The problem is we missed an instance during the refactor. This caused
restricted subnav pages (those set with the 'user_has_access' parameter
to false in bp_core_new_subnav_item()) to 404 instead of being redirected
away.

Commit fixes this problem.

See #7659.

File:
1 edited

Legend:

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

    r11447 r11814  
    609609
    610610    $parent_nav = $bp->{$component}->nav->get_primary( array( 'slug' => $r['parent_slug'] ), false );
     611    if ( ! $parent_nav ) {
     612        return ;
     613    }
     614
     615    $parent_nav = reset( $parent_nav );
    611616
    612617    // If we *do* meet condition (2), then the added subnav item is currently being requested.
Note: See TracChangeset for help on using the changeset viewer.