Last active
August 29, 2015 14:20
-
-
Save jdelia/2f92216911792c329877 to your computer and use it in GitHub Desktop.
Add Link to Widget Area in Toolbar
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 | |
//* 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 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original code posted had a trailing slash in the href url - now has been corrected. 5/8/2015