404 on Manage groups page
- 
		I am attempting to hide the “Delete Group” sub nav item in Groups >> Manage, using the following code in bp-custom.php if(!current_user_can(‘administrator’)){ 
 bp_core_remove_subnav_item( bp_get_current_group_slug() . ‘_manage’, ‘delete-group’ );}} This does delete the item. However it has an unusual side-effect I don’t understand: groups/test/admin/ brings up a 404 error (without the code above, this brings up the Manage >> Details tab) 
 groups/test/admin/edit-details still works after I type it in manually.How can I fix this? I have a fresh WP and BP install. Twenty-Sixteen theme. 
- 
		
			
Just a thought, have you considered a CSS solution? .tab { display: none; }I did but I want to check for a specific user role beforehand. In that case you could embed some CSS into the <head>section using thewp_headhook.Ref: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head Would that work if I wanted to check the user was an editor and NOT an administrator? Cracked it. Need to call bp_core_load_template after removing the navigation item. Final code: if(!current_user_can(‘administrator’)){ 
 bp_core_remove_subnav_item( bp_get_current_group_slug() . ‘_manage’, ‘delete-group’ );
 bp_core_load_template( ‘groups/single/settings/general’ );
 }
 }display: none;wasn’t the best solution. Glad you found a better way 🙂
- You must be logged in to reply to this topic.