WordPress - Remove menu pages only for non admin

1 week ago 13

I person this method successful my plugin, I privation to debar that the users that are not head tin spot immoderate menus successful the dashboard. I cognize that this tin beryllium achived utilizing the roles, but successful my lawsuit I volition person conscionable different 1 relationship that volition person writer permissions.

nationalist relation remove_default_menu_pages() { if( !is_user_admin() && is_user_logged_in() ){ remove_menu_page('edit.php'); remove_menu_page('edit-comments.php'); remove_menu_page('themes.php'); } }

I've noticed that besides if I'm logged arsenic an administrator, I'm not capable to spot the menus, successful the codification I've utilized the is_user_admin() relation truthful I was supposing that the cheque was done earlier removing the paper pages. Is determination immoderate crushed that WP person this beahviour?

Read Entire Article

Our Ventures