bp_avatar_is_front_edit

Checks whether Avatar UI should be loaded.

Description

bp_avatar_is_front_edit(); 

Usage

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

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. function bp_avatar_is_front_edit() { 
  2. $retval = false; 
  3.  
  4. // No need to carry on if the current WordPress version is not supported. 
  5. return $retval; 
  6.  
  7. if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) { 
  8. $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ); 
  9.  
  10. if ( bp_is_active( 'groups' ) ) { 
  11. // Group creation. 
  12. if ( bp_is_group_create() && bp_is_group_creation_step( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 
  13.  
  14. // Group Manage. 
  15. } elseif ( bp_is_group_admin_page() && bp_is_group_admin_screen( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 
  16.  
  17. /** 
  18. * Use this filter if you need to : 
  19. * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions) 
  20. * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false()) 
  21. * @since 2.3.0 
  22. * @param bool $retval Whether or not to load the Avatar UI. 
  23. */