Filter hook 'pre_move_uploaded_file'

in WP Core File wp-admin/includes/file.php at line 1010

Description

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. }

Occurrences

Filename Line Number
wp-admin/includes/file.php 1010

Parameters

Type Name Description
mixed $move_new_file If null (default) move the file after the upload.
array $file { Reference to a single element from `$_FILES`.
string $new_file Filename of the newly-uploaded file.
string $type Mime type of the newly-uploaded file.

PHP Doc

/**
	 * 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.
	 *
	 * @since 4.9.0
	 *
	 * @param mixed    $move_new_file If null (default) move the file after the upload.
	 * @param array    $file          {
	 *     Reference to a single element from `$_FILES`.
	 *
	 *     @type string $name     The original name of the file on the client machine.
	 *     @type string $type     The mime type of the file, if the browser provided this information.
	 *     @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server.
	 *     @type int    $size     The size, in bytes, of the uploaded file.
	 *     @type int    $error    The error code associated with this file upload.
	 * }
	 * @param string   $new_file      Filename of the newly-uploaded file.
	 * @param string   $type          Mime type of the newly-uploaded file.
	 */