[buddypress-trac] [BuddyPress Trac] #7659: Subnav menu with 'user_has_access' set to false should redirect but doesn't

buddypress-trac noreply at wordpress.org
Tue Jun 5 19:16:57 UTC 2018

#7659: Subnav menu with 'user_has_access' set to false should redirect but doesn't
 Reporter:  r-a-y             |       Owner:  (none)
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  3.0
Component:  Navigation        |     Version:  2.6.0
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |

Comment (by boonebgorges):

 [11814] broke compatibilty in cases where a plugin registered a subnav
 item *before* its corresponding parent. In most cases this doesn't make
 much sense, but in this specific case - where the plugin was using
 `bp_core_new_subnav_item()` to add a *group* subnav item - it's a little
 less silly. Anyway, the plugin was doing something like this:

 add_action( 'bp_setup_nav', function() {
     if ( ! bp_is_group() )

     bp_core_new_subnav_item( array(
         'parent_slug' => $current_group->slug, // etc
     ) );
 } );

 and because of WP's load order rules, this plugin happened to load before
 the Groups component was fully set up.

 The solution for this plugin is pretty simple: move to a later priority,
 after core components have had a chance to set up. So I'm not sure this is
 a bug worth worrying about, which is why I'm reporting it here rather than
 in a new ticket. But I wanted to record it for posterity.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7659#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list