Filters the override parameters for a file before it is uploaded to WordPress.
Description
The dynamic portion of the hook name, $action, refers to the post action. Possible hook names include: <ul> <li>wp_handle_sideload_overrides</li> <li>wp_handle_upload_overrides</li> </ul>
Parameters
$overridesarray|false
An array of override parameters for this file. Boolean false if none are provided. See _wp_handle_upload().
$filearray
{ Reference to a single element from $_FILES. @type string $name The original name of the file on the client machine. @type string $type The mime type of the file, if the browser provided this information. @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server. @type int $size The size, in bytes, of the uploaded file. @type int $error The error code associated with this file upload.}
$namestring
The original name of the file on the client machine.
$typestring
The mime type of the file, if the browser provided this information.
$tmp_namestring
The temporary filename of the file in which the uploaded file was stored on the server.
860* @type string$type The mime type of the file,if the browser provided this information.861* @type string$tmp_name The temporary filename of the file in which the uploaded file was stored on the server.862* @type int$size The size, in bytes, of the uploaded file.863* @type int$error The error code associated with this file upload.864*}865*/866$overrides=apply_filters("{$action}_overrides",$overrides,$file);867868// You may define your own function and pass the name in $overrides['upload_error_handler'].869$upload_error_handler='wp_handle_upload_error';870if(isset($overrides['upload_error_handler'])){871$upload_error_handler=$overrides['upload_error_handler'];872}
History
Introduced in 5.7.0. Unchanged from 6.7.7 through 7.1.0.