xxxxxxxxxx
// Hide WordPress admin bar
add_filter('show_admin_bar', '__return_false');
xxxxxxxxxx
/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );
xxxxxxxxxx
/*
* Add this to the bottom of your functions.php file to hide the wp admin
* bar for all users except those whom can edit posts.
*/
add_action('set_current_user', 'cc_hide_admin_bar');
function cc_hide_admin_bar() {
if (!current_user_can('edit_posts')) {
show_admin_bar(false);
}
}
xxxxxxxxxx
/**
* Removes some menus by page.
*/
function wpdocs_remove_menus(){
remove_menu_page( 'index.php' ); //Dashboard
remove_menu_page( 'jetpack' ); //Jetpack*
remove_menu_page( 'edit.php' ); //Posts
remove_menu_page( 'upload.php' ); //Media
remove_menu_page( 'edit.php?post_type=page' ); //Pages
remove_menu_page( 'edit-comments.php' ); //Comments
remove_menu_page( 'themes.php' ); //Appearance
remove_menu_page( 'plugins.php' ); //Plugins
remove_menu_page( 'users.php' ); //Users
remove_menu_page( 'tools.php' ); //Tools
remove_menu_page( 'options-general.php' ); //Settings
}
add_action( 'admin_menu', 'wpdocs_remove_menus' );
?>
xxxxxxxxxx
add_action("admin_menu", function(){
remove_submenu_page( 'themes.php', 'themes.php' );
remove_submenu_page( 'themes.php', 'nav-menus.php' );
remove_submenu_page( 'themes.php', 'theme-editor.php' );
});