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_file

If null (default) move the file after the upload.

$file

Reference to a single element from $_FILES.<br>

  • 'name'
    (string) The original name of the file on the client machine.<br>
  • 'type'
    (string) The mime type of the file, if the browser provided this information.<br>
  • 'tmp_name'
    (string) The temporary filename of the file in which the uploaded file was stored on the server.<br>
  • 'size'
    (int) The size, in bytes, of the uploaded file.<br>
  • 'error'
    (int) The error code associated with this file upload.<br>

$new_file

Filename of the newly-uploaded file.

$type

Mime type of the newly-uploaded file.


Source

File: wp-admin/includes/file.php

View on GitHub



Changelog

Changelog
Version Description
4.9.0 Introduced.