Gets a node.
Parameters
$id
stringrequired
Source
final public function get_node( $id ) {
$node = $this->_get_node( $id );
if ( $node ) {
return clone $node;
}
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
CARVIEW |
Gets a node.
$id
stringrequiredThis function returns a Toolbar object with all the properties of a single Toolbar item. Toolbar items are also called “nodes”.
The parameter $id is the node ID of the Toolbar item you want to get. Default is None.
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 example from get_nodes().
final public function get_node( $id ) {
$node = $this->_get_node( $id );
if ( $node ) {
return clone $node;
}
}
Uses | Description |
---|---|
WP_Admin_Bar::_get_node()wp-includes/class-wp-admin-bar.php |
Used by | Description |
---|---|
WP_Admin_Bar::add_node()wp-includes/class-wp-admin-bar.php | Adds a node to the menu. |
Version | Description |
---|---|
3.3.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Remove the Toolbar “Updates” Item if it Exists
Put this in your theme’s functions.php file.