Advertisement
Osisis

Add My Groups to Adminbar

Jun 7th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function bp_my_groups_menu() {
  2. global $wp_admin_bar;
  3.  
  4. $menu_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() );
  5.  
  6. $wp_admin_bar->add_menu( array(
  7. 'parent' => 'top-secondary',
  8. 'id' => 'groups-my-groups',
  9. 'title' => 'My Groups',
  10. 'href' => $menu_link,
  11. ) );
  12. }
  13. add_action( 'admin_bar_menu', 'bp_my_groups_menu', 90 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement