Hide access to non admin role
-
Hello. I’d like to hide access to this plugin for any backend rol which is not the administrator.
I could use something like below if i knew what the permission was. “trustindex-google-reviews” does not seem to work. Anyone got a solution for this?Thank-you
function hide_trustindex_from_editors() {
if (!current_user_can(‘administrator’)) {
remove_menu_page(‘trustindex-google-reviews’); // You may need to update this slug
}
}
add_action(‘admin_menu’, ‘hide_trustindex_from_editors’, 999);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Hide access to non admin role’ is closed to new replies.