On this page
apply_filters( 'pre_move_uploaded_file', mixed $move_new_file, array $file, string $new_file, string $type )
Filters whether to short-circuit moving the uploaded file after passing all checks.
Description
If a non-null value is returned from the filter, moving the file and any related error reporting will be completely skipped.
Parameters
$move_new_filemixed-
If null (default) move the file after the upload.
$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.
$new_filestring-
Filename of the newly-uploaded file.
$typestring-
Mime type of the newly-uploaded file.
Source
File: wp-admin/includes/file.php. View all references
$move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );
Related
Used By
| Used By | Description |
|---|---|
| _wp_handle_upload() wp-admin/includes/file.php | Handles PHP uploads in WordPress. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_move_uploaded_file