Remove admin menu wordpress

<?php
function hide_menu() {
global $menu;
$restricted = array(__(‘Dashboard’), __(‘Posts’), __(‘Media’), __(‘Plugins’));
end ($menu);
while (prev($menu)){
$value = explode(‘ ‘,$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){unset($menu[key($menu)]);}
}
}
add_action(‘admin_menu’, ‘hide_menu’);
?>
Share

Leave a Reply

Your email address will not be published. Required fields are marked *