bp_core_check_avatar_type

Does the current avatar upload have an allowed file type?.

Description

bp_core_check_avatar_type( (array) $file ); 

Permitted file types are JPG, GIF and PNG.

Parameters (1)

0. $file (array)
The $_FILES array.

Usage

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

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. function bp_core_check_avatar_type( $file ) { 
  2. return bp_attachments_check_filetype( $file['file']['tmp_name'], $file['file']['name'], bp_core_get_allowed_avatar_mimes() );