WP HOOKS
filtrod 4.9.0

pre_move_uploaded_file

Args 4Plik wp-admin/includes/file.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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.

Parametry

ParametrTypOpis
$move_new_filemixedIf null (default) move the file after the upload.
$filearray{ Reference to a single element from <code>$_FILES</code>. @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. }
$new_filestringFilename of the newly-uploaded file.
$typestringMime type of the newly-uploaded file.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_move_uploaded_file', 'twoja_funkcja', 10, 4 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
	// Twój kod
}

Popularne w tej kategorii