This function returns a Toolbar object with all the properties of a single Toolbar item. Toolbar items are also called "nodes".
The Toolbar replaces the Admin Bar since WordPress Version 3.3.
note: This function is a method of the WP_Admin_Bar class and $wp_admin_bar global object, which may not exist except during the 'admin_bar_menu' or 'wp_before_admin_bar_render' hooks.
<?php $wp_admin_bar->get_node( $id ); ?>
The node ID's can be found in the HTML source code of any WordPress page with a Toolbar on it. Find the list items that have ID's that start with "wp-admin-bar-". For example, the list item ID for the WordPress Logo on the left in the Toolbar is "wp-admin-bar-wp-logo":
<li id="wp-admin-bar-wp-logo" class="menupop"> … </li>
Remove "wp-admin-bar-" from the list item ID to get the node ID. From this example the node ID is "wp-logo".
Note: It's also possible to see all node ID's with this example from get_nodes().
Put this in your theme's functions.php file.
add_action( 'admin_bar_menu', 'check_updates_node', 999 ); function check_updates_node( $wp_admin_bar ) { $updates_node = $wp_admin_bar->get_node( 'updates' ); // Check if the 'updates' node exists if( $updates_node ) { $wp_admin_bar->remove_node( 'updates' ); } }
get_node() is located in wp-includes/class-wp-admin-bar.php
.