When you’re logged in to the WordPress admin, there’s that pesky “+New” dropdown in the menu bar across the top. If you don’t want it, just remove it!

When you’re logged in to the WordPress admin, there’s that pesky “+New” dropdown in the menu bar across the top. If you don’t want it, just remove it!
<?php
// Admin Menu: Remove the +New Dropdown Menu When Logged In
// https://snipsnip.pro/s/299
// For removing items other than the "New" menu, see here: https://snipsnip.pro/s/249
namespace Gw7RGsk;
function remove_newmenu_from_top_admin_menu() {
// if you only want to remove it for certain users/roles you could do something
// lik: get_current_user then check: if (in_array('editor',$user->roles)) {}
global $wp_admin_bar;
// remove the entire +New menu
$wp_admin_bar->remove_menu('new-content');
}
\add_action( 'wp_before_admin_bar_render', '\Gw7RGsk\remove_newmenu_from_top_admin_menu' );