I want to hide a submenu. How do I do this?

I have used this function, but it does not work.

function remove_admin_bar_links() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('new-post');
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );an you please follow this route ...
Please see chat for path and login details.