Forums
Home / Plugin: Members - Membership & User Role Editor Plugin / Hide Snippets from left bar
(@laurpm)
2 years, 3 months ago
Hello everyone!
Is there a way to hide the Code Snippets plugin from the left bar, for a Shop Manager role? Or Editor?
Thank you!
View post on imgur.com
(@caseproof)
Hi @laurpm
Try to add this code snippet at the end of your theme’s functions.php file:
add_action('admin_menu', function() { if(!current_user_can('administrator')){ remove_menu_page( 'snippets' ); } }, 999);
This should remove Snippets menu for all roles except for Administrator.
I hope that helps.
yeeeey thank you! it works!