GLOBALS menu

GLOBALS menu

add_action( 'admin_init', function () {
  var_dump($GLOBALS[ 'menu' ]); exit;
} );
add_action('admin_init', 'set_admin_menu');  // add_action('admin_menu', 'set_admin_menu'); :-(
function set_admin_menu(){
  $user = wp_get_current_user();
  if( $user && isset($user->user_email) && in_array($user->user_email,['wordpress [at] cloudmeister [dot] services'])) {
    remove_menu_page('tools.php');
    remove_menu_page('index.php');
    remove_menu_page('themes.php');
    remove_menu_page('options-general.php');
    remove_menu_page('plugins.php');
    remove_menu_page('users.php');
    remove_menu_page('edit-comments.php');
    remove_menu_page('page.php');
    remove_menu_page('upload.php');
    remove_menu_page( 'edit.php?post_type=page'); // Seiten
    remove_menu_page( 'delete_all_posts');
    // remove_menu_page( 'edit.php?post_type=contact'); // Kontakte
    // remove_menu_page( 'edit.php?post_type=receipt'); //Belege
    // remove_menu_page( 'edit.php?post_type=videos' );
    remove_menu_page( 'edit.php' );	// Beiträge
    remove_menu_page( 'separator1');
    remove_menu_page( 'separator2');
    remove_menu_page( 'separator-last');
    remove_menu_page( 'pmxe-admin-home');
    remove_menu_page( 'pmxi-admin-home');
  }
}

 

Share this post

Share on facebook
Share on twitter
Share on pinterest
Share on email