bp_core_signup_avatar_upload_dir

Get the avatar storage directory for use during registration.

Description

(string|bool) bp_core_signup_avatar_upload_dir(); 

Returns (string|bool)

Directory path on success, false on failure.


Usage

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

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_core_signup_avatar_upload_dir() { 
  2. $bp =buddypress); 
  3.  
  4. if ( empty( $bp->signup->avatar_dir ) ) { 
  5. return false; 
  6.  
  7. $directory = 'avatars/signups'; 
  8. $path = bp_core_avatar_upload_path() . '/' . $directory . '/' . $bp->signup->avatar_dir; 
  9. $newbdir = $path; 
  10. $newurl = bp_core_avatar_url() . '/' . $directory . '/' . $bp->signup->avatar_dir; 
  11. $newburl = $newurl; 
  12. $newsubdir = '/' . $directory . '/' . $bp->signup->avatar_dir; 
  13.  
  14. /** 
  15. * Filters the avatar storage directory for use during registration. 
  16. * @since 1.1.1 
  17. * @param array $value Array of path and URL values for created storage directory. 
  18. */ 
  19. 'path' => $path,  
  20. 'url' => $newurl,  
  21. 'subdir' => $newsubdir,  
  22. 'basedir' => $newbdir,  
  23. 'baseurl' => $newburl,  
  24. error => false 
  25. ) );