I’ve created a custom role that can edit groups, so it has the ‘manage_options’ capability assigned.
Now I’m trying to hide the option Tools > BuddyPress from the administration menu for this role. I was following this tutorial but I cannot find the way to address that specific page.
I’m using this code but it’s not working:
The page URL is different from administrator role to the others.
URL for Administrators: /wp-admin/tools.php?page=bp-tools
URL for other roles: /wp-admin/export-personal-data.php?page=bp-tools
The manage_options capability allows a user to do most anything in wp-admin.
So focusing on the bp-tools screen seems like a minor issue.
Preventing access to that screen while allowing them to have access to everything else seems like a recipe for trouble.
But if you are committed to preventing that access, the easiest approach would be to redirect them when they try to access it.