This morning, while working in my support forum for Easy Digital Downloads, I needed to look up a user’s account. Instinctively, I went to the site menu in the tool bar, opened the sub menu and tried to navigate straight to the Users admin page. That’s when I remembered there isn’t a Users link added to the site menu, so out of my own personal desire for a short cut to a page I spend a lot of time interacting with, the Users Site Menu Link plugin was born.
The plugin is extremely simple (just 14 lines of PHP) and just adds a new Users link to the main site menu in the toolbar:
Thanks to the $wp_admin_bar class, adding a new link to the toolbar is extremely simple:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <?php /* * Plugin Name: Users Site Menu Link * Description: Adds a link to the Users management page to the site's toolbar admin menu * Author: Pippin Williamson * Author URI: https://pippinsplugins.com * Version: 1.0 */ function pw_users_site_menu_link( $wp_admin_bar ) { if( is_admin() || ! current_user_can( 'edit_users' ) ) { return; } $args = array( 'parent' => 'site-name', 'id' => 'users', 'title' => __( 'Users' ), 'href' => admin_url( 'users.php' ) ); $wp_admin_bar->add_node( $args ); } add_action( 'admin_bar_menu', 'pw_users_site_menu_link', 999 ); |
Simple, but extreme useful. Great add on.
Thanks, Pippin.
Thanks for the useful tip!
Good stuff Pippin. Speaking of good stuff maybe you would like to add your site / participate in the Day We Fight Back Action? Or maybe just help spread the word?
https://thedaywefightback.org/
Best Regards,
Ed
This is just one of those duh moments when I have to think “Really, why isn’t that in core”?
Thanks Pippin, for bringing sanity back, again.
Now that is handy little plugin, thanks Pippin!