WP HOOKS
filtrdynamicznyod 5.7.0

{$action}_overrides

Args 2Plik wp-admin/includes/file.php

Opis — z kodu źródłowego

Filters the override parameters for a file before it is uploaded to WordPress.

The dynamic portion of the hook name, $action, refers to the post action. Possible hook names include:

  • wp_handle_sideload_overrides
  • wp_handle_upload_overrides

Hook dynamiczny — możliwe nazwy

wp_handle_sideload_overrideswp_handle_upload_overrides

Parametry

ParametrTypOpis
$overridesarray | falseAn array of override parameters for this file. Boolean false if none are provided. See {@see _wp_handle_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. }

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '{$action}_overrides', 'twoja_funkcja', 10, 2 );

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

Popularne w tej kategorii