bp_core_get_allowed_avatar_types

Get allowed avatar types.

Description

(array) bp_core_get_allowed_avatar_types(); 

Returns (array)


Usage

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

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. function bp_core_get_allowed_avatar_types() { 
  2. $allowed_types = bp_attachments_get_allowed_types( 'avatar' ); 
  3.  
  4. /** 
  5. * Filters the list of allowed image types. 
  6. * @since 2.3.0 
  7. * @param array $allowed_types List of image types. 
  8. */ 
  9. $avatar_types = (array) apply_filters( 'bp_core_get_allowed_avatar_types', $allowed_types ); 
  10.  
  11. if ( empty( $avatar_types ) ) { 
  12. $avatar_types = $allowed_types; 
  13. } else { 
  14. $avatar_types = array_intersect( $allowed_types, $avatar_types ); 
  15.  
  16. return array_values( $avatar_types );