How to Hide Leaflet Map in Menu for non-admin users ?
-
Hi,
I want to hide the “leaflet-shortcode-helper” menu for non-admin users.
I tried in functions.php :
function my_remove_menu_items() { if ( !current_user_can( 'administrator' ) ) : // IF NON ADMIN USER remove_menu_page( 'leaflet-map' ); // or remove_menu_page( 'leaflet-shortcode-helper' ); endif; } add_action( 'admin_menu', 'my_remove_menu_items' );
but it doesn’t work…
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to Hide Leaflet Map in Menu for non-admin users ?’ is closed to new replies.