bp_members_adminbar_admin_menu

Add a member admin menu to the BuddyBar.

Description

bp_members_adminbar_admin_menu(); 

Adds an Toolbar menu to any profile page providing site moderator actions that allow capable users to clean up a users account.


Usage

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

Defined (1)

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

/bp-core/deprecated/2.1.php  
  1. function bp_members_adminbar_admin_menu() { 
  2.  
  3. // Only show if viewing a user 
  4. if ( ! bp_displayed_user_id() ) { 
  5. return false; 
  6.  
  7. // Don't show this menu to non site admins or if you're viewing your own profile 
  8. if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) { 
  9. return false; 
  10. } ?> 
  11.  
  12. <li id="bp-adminbar-adminoptions-menu"> 
  13.  
  14. <a href=""><?php _e( 'Admin Options', buddypress ) ?></a> 
  15.  
  16. <ul> 
  17. <?php if ( bp_is_active( 'xprofile' ) ) : ?> 
  18.  
  19. <li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", buddypress ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li> 
  20.  
  21. <?php endif ?> 
  22.  
  23. <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Profile Photo", buddypress ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li> 
  24.  
  25. <li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', buddypress ); ?></a></li> 
  26.  
  27. <li><a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>"><?php printf( __( "Delete %s's Account", buddypress ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li> 
  28.  
  29.  
  30. </ul> 
  31. </li> 
  32.  
  33. <?php