filtrod 4.9.0
pre_move_uploaded_file
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
| Parametr | Typ | Opis |
|---|---|---|
$move_new_file | mixed | If null (default) move the file after the upload. |
$file | array | { 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_file | string | Filename of the newly-uploaded file. |
$type | string | Mime 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
}
// 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