Codex tools: Log in
WP_Admin_Bar is WordPress' class for generating the Toolbar that lines the top of of WordPress sites when signed in. This class can be hooked and modified to add or remove options that appear in the admin bar.
note: Additional Toolbar functions are available outside the class for use in manipulating the $wp_admin_bar object. See /wp-includes/admin-bar.php or the Related section at the bottom of this article for more information.
The WP_Admin_Bar class is located in the file /wp-includes/class-wp-admin-bar.php
The following hooks are available for modifying this class:
Please note that these hooks have very limited use. In many cases, you will simply want to modify the $wp_admin_bar object. See usage below for more information.
This class is used internally by WordPress to create an object called $wp_admin_bar. Most modifications to WordPress' admin bar will generally be done by modifying the $wp_admin_bar object with the wp_before_admin_bar_render hook, and NOT necessarily through WP_Admin_Bar's internal hooks.
This can be used to add a node (such as a new menu) to the admin bar object. It accepts one array containing arguments.
This method can be used to remove any pre-defined node from the object. It accepts one argument, the id of the node to be removed.