WordPress 3.1 introduced a new feature, the WP Admin Bar.
Here’s how to customise it by removing existing links and adding new links.
The WP Admin Bar
The new Admin Bar appeared in the v3.1 release of WordPress many developers were quick to disable it completely.
True, it could have been turned off by default allowing the feature to be discovered. This may have stopped the “Woah – what is that thing at the top of my website and how can I get rid of it?” attitude.
It’s only now that developers are starting to play with the features it offers, customising it to their website needs.
Customizing The WP Admin Bar
Modifying the WP Admin Bar works by adding a function and hook to your theme’s functions.php file. Here’e the basic code.
WP Admin Bar Default Link IDs
The WP Admin Bar default link IDs can be found in the /wp-includes/admin-bar.php file. Here’s a summary of those link IDs:
- my-account – the link to your account (if you haven’t enabled avatars)
- my-account-with-avatar – the link to your account (if avatars are enabled)
- my-blogs – the ‘My Sites’ menu if the user has more than one site
- get-shortlink – provides a Shortlink to that page
- edit – link to Edit [content-type]
- new-content – the ‘Add New’ drop-down menu link
- comments – the ‘Comments’ drop-down menu link
- appearance – the ‘Appearance’ drop-down menu link
- updates – the ‘Updates’ drop-down menu link
Using the WP Admin Bar
We have recently introduced a client area where our customers can log in and get their own relevant project information.
Each customer has a “home page” which is specified on the users profile and we have added a “Customer Home” link to the WP Admin Bar that always takes them to their specific homepage, wherever they may be in our site.
How have you customised yours?
Take a screenshot of your WP Admin Bar customizations and send them in to us. We’ll publish the best ones along with a link to the website on our Facebook Page.