bp_core_set_avatar_globals

Set up global variables related to avatars.

Description

bp_core_set_avatar_globals(); 

Usage

  1. if ( !function_exists( 'bp_core_set_avatar_globals' ) ) { 
  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_core_set_avatar_globals(); 
  7.  

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. function bp_core_set_avatar_globals() { 
  2. $bp =buddypress); 
  3.  
  4. $bp->avatar = new stdClass; 
  5. $bp->avatar->thumb = new stdClass; 
  6. $bp->avatar->full = new stdClass; 
  7.  
  8. // Dimensions. 
  9. $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH
  10. $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT
  11. $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH
  12. $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT
  13.  
  14. // Upload maximums. 
  15. $bp->avatar->original_max_width = BP_AVATAR_ORIGINAL_MAX_WIDTH
  16. $bp->avatar->original_max_filesize = BP_AVATAR_ORIGINAL_MAX_FILESIZE
  17.  
  18. // Defaults. 
  19. $bp->avatar->thumb->default = bp_core_avatar_default_thumb(); 
  20. $bp->avatar->full->default = bp_core_avatar_default(); 
  21.  
  22. // These have to be set on page load in order to avoid infinite filter loops at runtime. 
  23. $bp->avatar->upload_path = bp_core_avatar_upload_path(); 
  24. $bp->avatar->url = bp_core_avatar_url(); 
  25.  
  26. // Cache the root blog's show_avatars setting, to avoid unnecessary 
  27. // calls to switch_to_blog(). 
  28. $bp->avatar->show_avatars = (bool) BP_SHOW_AVATARS
  29.  
  30. // Backpat for pre-1.5. 
  31. if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) ) 
  32. define( 'BP_AVATAR_UPLOAD_PATH', $bp->avatar->upload_path ); 
  33.  
  34. // Backpat for pre-1.5. 
  35. if ( ! defined( 'BP_AVATAR_URL' ) ) 
  36. define( 'BP_AVATAR_URL', $bp->avatar->url ); 
  37.  
  38. /** 
  39. * Fires at the end of the core avatar globals setup. 
  40. * @since 1.5.0 
  41. */