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 = apply_filters( "{$action}_prefilter", $file );
User Contributed Notes
You must log in before being able to contribute a note or feedback.