bp_registration_options_admin_bar_add

Adds our setting links to the BuddyPress member menu for our administrators.

Description

bp_registration_options_admin_bar_add(); 

Usage

  1. if ( !function_exists( 'bp_registration_options_admin_bar_add' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_registration_options_admin_bar_add(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/core.php  
  1. function bp_registration_options_admin_bar_add() { 
  2. global $wp_admin_bar, $bp; 
  3.  
  4. if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) { 
  5. return false; 
  6.  
  7. if ( ! current_user_can( 'delete_users' ) ) { 
  8. return false; 
  9.  
  10. $general_settings = admin_url( 'admin.php?page=bp_registration_options' ); 
  11. $member_requests = admin_url( 'admin.php?page=bp_registration_options_member_requests' ); 
  12.  
  13. $wp_admin_bar->add_menu( array( 
  14. 'parent' => $bp->my_account_menu_id,  
  15. 'id' => 'bp-registration-options',  
  16. 'title' => __( 'BP Registration Options', 'bp-registration-options' ),  
  17. 'meta' => array( 'class' => 'menupop' ),  
  18. 'href' => $general_settings,  
  19. ) ); 
  20.  
  21. // Submenus. 
  22. $wp_admin_bar->add_menu( array( 
  23. 'parent' => 'bp-registration-options',  
  24. 'id' => 'bp-registration-options-general-settings',  
  25. 'title' => __( 'General Settings', 'bp-registration-options' ),  
  26. 'href' => $general_settings,  
  27. ) ); 
  28. // Submenus. 
  29. $wp_admin_bar->add_menu( array( 
  30. 'parent' => 'bp-registration-options',  
  31. 'id' => 'bp-registration-options-member-requests',  
  32. 'title' => __( 'Member Requests', 'bp-registration-options' ),  
  33. 'href' => $member_requests,  
  34. ) ); 
  35.  
  36. return true;