Created
January 8, 2013 12:20
-
-
Save danielsneijers/4483319 to your computer and use it in GitHub Desktop.
Add an item to the Wordpress admin bar. Useful for quick links to settings!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mytheme_admin_bar_render() { | |
global $wp_admin_bar; | |
$wp_admin_bar->add_menu( array( | |
'parent' => false, // use 'false' for a root menu, or pass the ID of the parent menu | |
'id' => 'cache_settings', // link ID, defaults to a sanitized title value | |
'title' => __('Cache Settings'), // link title | |
'href' => admin_url( 'options-general.php?page=wpsupercache'), // name of file | |
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' ); | |
)); | |
} | |
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment