Bring in wp_handle_upload_prefilter from MU

git-svn-id: http://svn.automattic.com/wordpress/trunk@12142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-11-05 14:24:20 +00:00
parent cf7279320b
commit 2498bb6cae
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'] // You may define your own function and pass the name in $overrides['upload_error_handler']
$upload_error_handler = 'wp_handle_upload_error'; $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'] // You may define your own function and pass the name in $overrides['unique_filename_callback']
$unique_filename_callback = null; $unique_filename_callback = null;