On this page
apply_filters( "{$action}_overrides", array|false $overrides, array $file )
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:
wp_handle_sideload_overrideswp_handle_upload_overrides
Parameters
$overridesarray|false-
An array of override parameters for this file. Boolean false if none are provided. @see _wp_handle_upload() .
More Arguments from _wp_handle_upload( ... $overrides )
An array of override parameters for this file, or boolean false if none are provided.
upload_error_handlercallableFunction to call when there is an error during the upload process.
@see wp_handle_upload_error() .unique_filename_callbackcallableFunction to call when determining a unique file name for the file.
@see wp_unique_filename() .upload_error_stringsstring[]The strings that describe the error indicated in$_FILES[{form field}]['error'].test_formboolWhether to test that the$_POST['action']parameter is as expected.test_sizeboolWhether to test that the file size is greater than zero bytes.test_typeboolWhether to test that the mime type of the file is as expected.mimesstring[]Array of allowed mime types keyed by their file extension regex.
$filearray-
Reference to a single element from
$_FILES.
namestringThe original name of the file on the client machine.typestringThe mime type of the file, if the browser provided this information.tmp_namestringThe temporary filename of the file in which the uploaded file was stored on the server.sizeintThe size, in bytes, of the uploaded file.errorintThe error code associated with this file upload.
Source
File: wp-admin/includes/file.php. View all references
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );
Related
Used By
| Used By | Description |
|---|---|
| _wp_handle_upload() wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
Changelog
| Version | Description |
|---|---|
| 5.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/action_overrides