On this page
apply_filters( "{$action}_prefilter", array $file )
Filters the data 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_prefilterwp_handle_upload_prefilter
Parameters
$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
$file = apply_filters( "{$action}_prefilter", $file );
Related
Used By
| Used By | Description |
|---|---|
| _wp_handle_upload() wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/action_prefilter