Admin bar

From WordPress Codex:
The Toolbar is an area of the screen just above the site that lists useful admininstration screen links such as add a new post or edit your profile. The Toolbar concept was added to WordPress in Version 3.1 as Admin Bar and in Version 3.3 it was replaced by theToolbar.

toolbar-MP6.png

The Toolbar contains links to information about WordPress, as well as quick-links to create new posts, pages and links, add new users, review comments, and alerts to available updates to plugins and themes on your site.

The toolbar can be turned on/off from the Toolbar option in Administration > Users > Your Profile, but It is no longer possible to hide the Toolbar when viewing the Administration Screens.


Note: If you have turned the Toolbar on in your profile settings, but still don’t see it on the front end of your site, it may be that your theme does not call _F9J_footer() in its footer.php file, or the Toolbar may be disabled by a plugin.

From WordPress Codex:

Role of _F9J_Admin_Bar

_F9J_Admin_Bar is WordPress’ class for generating the Toolbar that lines the top of WordPress sites when signed in. This class can be hooked and modified to add or remove options that appear in the admin bar.

The Toolbar replaces the Admin Bar since WordPress Version 3.3.

Usage

This class is used internally by WordPress to create an object called $_F9J_admin_bar. Most modifications to WordPress toolbar will generally be done by modifying the $_F9J_admin_bar object that is passed through the admin_bar_menu hook.

From WordPress Codex:

Class Reference/WP Admin Bar/add menu

Create or add new items into the Admin bar.

This is not a function. It is a method of the $_F9J_admin_bar global (an instance of _F9J_Admin_Bar), which may not exist except during the ‘admin_bar_menu’ hook.

Note: The Admin Bar is replaced with the Toolbar since WordPress Version 3.3. The preferred way to add items to the toolbar is with add_node().

Initial items in the Admin Bar are($menu_id):

  • my-account-with-avatar – Dashboard, User settings
  • new-content – Short-cut to all custom post types and original ones
  • comments – Comments moderation
  • appearance – Theme selection and Widgets

<?php $_F9J_admin_bar->add_menu( $args ) ?>

$args
(array) (required) An array of arguments.
Default: None

Arguments

id
(string) (required) The ID of the node.

Default: false
title
(string) (optional) The text that will be visible in the Toolbar. Including html tags is allowed.

Default: false
parent
(string) (optional) The ID of the parent node.

Default: false
href
(string) (optional) The ‘href’ attribute for the link. If ‘href’ is not set the node will be a text node.

Default: false
group
(boolean) (optional) This will make the node a group (node) if set to ‘true’. Group nodes are not visible in the Toolbar, but nodes added to it are. See add_group().

Default: false
meta
(array) (optional) An array of meta data for the node.

Default: array()
  • ‘html’ – The html used for the node.
  • ‘class’ – The class attribute for the list item containing the link or text node.
  • ‘rel’ – The rel attribute.
  • ‘onclick’ – The onclick attribute for the link. This will only be set if the ‘href’ argument is present.
  • ‘target’ – The target attribute for the link. This will only be set if the ‘href’ argument is present.
  • ‘title’ – The title attribute. Will be set to the link or to a div containing a text node.
  • ‘tabindex’ – The tabindex attribute. Will be set to the link or to a div containing a text node.