* @see bp_core_check_avatar_type()
*/
function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
global $bp;
/***
* You may want to hook into this filter if you want to override this function.
* Make sure you return false.
*/
if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
return true;
require_once( ABSPATH . '/wp-admin/includes/image.php' );
require_once( ABSPATH . '/wp-admin/includes/file.php' );
$uploadErrors = array(
0 => __("There is no error, the file uploaded with success", 'buddypress'),
1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
3 => __("The uploaded file was only partially uploaded", 'buddypress'),