Rule #1 – This is my blog.

Add Shortcuts on WordPress Admin Bar

If you find yourself constantly modifying plugins and style sheets, you might want to make the process of navigating from the homepage to the options page a bit faster. You can easily add shortcuts to the admin bar by adding this code in your functions.php file.

function add_admin_bar_shortcuts() {
   if ( current_user_can( 'edit_theme_options' ) ) {
     global $wp_admin_bar;
     $wp_admin_bar->add_menu( array(
       'parent' => 'appearance',
       'id' => 'theme_editor_admin_bar',
       'title' => ('Editor'),
       'href' => admin_url( 'theme-editor.php')
     ));
     $wp_admin_bar->add_menu( array(
       'parent' => 'appearance',
       'id' => 'plugins_admin_bar',
       'title' => ('Plugins'),
       'href' => admin_url( 'plugins.php')
     ));
   }
}
add_action( 'wp_before_admin_bar_render', 'add_admin_bar_shortcuts' );

Using the code above adds two additional menu items, shortcuts to the Plugins page and the Editor page. You can follow the format and add additional shortcuts of your choice.
admin-bar-shortcut
Change the value of href to your desired address.

'href' => 'http://ronangelo.com'
Share This Post :

Leave a Reply

Please write your comments in english. I delete anything that even remotely resembles spam.

Note: When posting code, enclose it in pre and code tags.
e.g. <pre><code> Add code here </code></pre>

ronangelo © 2014 Frontier Theme
css.php