Bring in wp_handle_upload_prefilter from MU

git-svn-id: https://develop.svn.wordpress.org/trunk@12142 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-11-05 14:24:20 +00:00
parent a093c8c7c0
commit af42a894f0
1 changed files with 6 additions and 0 deletions

View File

@ -223,9 +223,15 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
}
}
$file = apply_filters( 'wp_handle_upload_prefilter', $file );
// You may define your own function and pass the name in $overrides['upload_error_handler']
$upload_error_handler = 'wp_handle_upload_error';
// You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.
if ( isset( $file['error'] ) && !ctype_digit( $file['error'] ) && $file['error'] )
return $upload_error_handler( $file, $file['error'] );
// You may define your own function and pass the name in $overrides['unique_filename_callback']
$unique_filename_callback = null;