Remove a node.
Parameters
$id
stringrequired- The ID of the item.
Source
public function remove_node( $id ) {
$this->_unset_node( $id );
}
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
CARVIEW |
Remove a node.
$id
stringrequiredThis function removes an item from the Toolbar. Toolbar items are also called “nodes”.
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 the example from get_nodes().
public function remove_node( $id ) {
$this->_unset_node( $id );
}
Uses | Description |
---|---|
WP_Admin_Bar::_unset_node()wp-includes/class-wp-admin-bar.php |
Used by | Description |
---|---|
WP_Admin_Bar::_bind()wp-includes/class-wp-admin-bar.php | |
WP_Admin_Bar::remove_menu()wp-includes/class-wp-admin-bar.php | Removes a node from the admin bar. |
Version | Description |
---|---|
3.1.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
The following code removes the Customizer links, Background and Header from the Toolbar drop-downs:
The following code removes the WP logo and the Comments menu: