[Resolved] How to remove tabs from group admin nav
-
Hi @imath,
In this topic you write that the function you provided should work with BuddyPress Version 2.2
https://buddypress.org/support/topic/how-to-remove-tabs-from-group-admin-nav/#post-230995function turker_remove_group_admin_tab() { if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) { return; } // Add the admin subnav slug you want to hide in the // following array $hide_tabs = array( 'group-avatar' => 1, 'delete-group' => 1, ); $parent_nav_slug = bp_get_current_group_slug() . '_manage'; // Remove the nav items foreach ( array_keys( $hide_tabs ) as $tab ) { bp_core_remove_subnav_item( $parent_nav_slug, $tab ); } // You may want to be sure the user can't access if ( ! empty( $hide_tabs[ bp_action_variable( 0 ) ] ) ) { bp_core_add_message( 'Sorry buddy, but this part is restricted to super admins!', 'error' ); bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) ); } } add_action( 'bp_actions', 'turker_remove_group_admin_tab', 9 );
There is still one issue with the manage link like named from @danbp
The normal link is groups/GROUP-SLUG/admin/ and it will become a 404
groups/GROUP-SLUG/admin/edit-details/ will work.
How can I change the manage link to groups/GROUP-SLUG/admin/edit-details/
or better do you have a working solution? Hope you can help.
Cheers,
Sven
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘[Resolved] How to remove tabs from group admin nav’ is closed to new replies.