bp_core_can_edit_settings

Check whether the logged-in user can edit settings for the displayed user.

Description

bp_core_can_edit_settings(); 

Usage

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

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_core_can_edit_settings() { 
  2. $status = false; 
  3.  
  4. if ( bp_is_my_profile() ) { 
  5. $status = true; 
  6. } elseif ( is_super_admin( bp_displayed_user_id() ) && ! is_super_admin() ) { 
  7. $status = false; 
  8. } elseif ( bp_current_user_can( 'bp_moderate' ) || current_user_can( 'edit_users' ) ) { 
  9. $status = true; 
  10.  
  11. /** 
  12. * Filters the status of whether the logged-in user can edit settings for the displayed user or not. 
  13. * @since 2.8.0 
  14. * @param bool True if editing is allowed, otherwise false. 
  15. */