Hello sir, seriously i must commend you for your wonderful supports.
Please kindly help me with the following code:
/*
REMOVE DASHBOARD MENUS FOR ALL BUT ADMINISTRATOR
*/
if ( ! current_user_can(‘manage_options’) ) {
add_action( ‘admin_menu’, ‘notadmin_remove_menus’, 999 );
}
function notadmin_remove_menus() {
remove_menu_page(‘tools.php’);
remove_submenu_page( ‘themes.php’, ‘themes.php’ ); // hide the theme selection submenu
remove_submenu_page( ‘themes.php’, ‘widgets.php’ ); // hide the widgets submenu
remove_submenu_page( ‘themes.php’, ‘customize.php?return=%2Fwp-admin%2Fprofile.php’ ); // hide the customizer submenu
remove_submenu_page( ‘themes.php’, ‘themes.php?page=generate-options’ ); //hide generatepress submenu
}
I used the above code to remove items from dashboard “Appearance sub menus” and it successfully removed them except “Customizer” and “Generatepress” . please any correction in the code?