Skip to content

Instantly share code, notes, and snippets.

@jdelia
Last active August 29, 2015 14:20
Show Gist options
  • Save jdelia/2f92216911792c329877 to your computer and use it in GitHub Desktop.
Save jdelia/2f92216911792c329877 to your computer and use it in GitHub Desktop.
Add Link to Widget Area in Toolbar
<?php
//* Do NOT include the opening php tag
// Adds a Widget link to the Toolbar
add_action( 'admin_bar_menu', 'toolbar_link_to_widget_page', 999 );
function toolbar_link_to_widget_page( $wp_admin_bar ) {
$args = array(
'id' => 'my_widget_page',
'title' => 'My Widgets',
'href' => '/wp-admin/widgets.php',
'meta' => array( 'class' => 'my-toolbar-widget-page' )
);
$wp_admin_bar->add_node( $args );
}
@jdelia
Copy link
Author

jdelia commented May 8, 2015

Original code posted had a trailing slash in the href url - now has been corrected. 5/8/2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment