pre_move_uploaded_file filter-hook . WP 4.9.0
Filters whether to short-circuit moving the uploaded file after passing all checks.
If a non-null value is returned from the filter, moving the file and any related error reporting will be completely skipped.
Usage
add_filter( 'pre_move_uploaded_file', 'filter_function_name_9713', 10, 4 ); function filter_function_name_9713( $move_new_file, $file, $new_file, $type ){ // filter... return $move_new_file; }
- $move_new_file(mixed)
- If null (default) move the file after the upload.
- $file(string[])
- An array of data for a single file.
- $new_file(string)
- Filename of the newly-uploaded file.
- $type(string)
- Mime type of the newly-uploaded file.
Changelog
Since 4.9.0 | Introduced. |
Where the hook is called
wp-admin/includes/file.php 893
$move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );