WP HOOKS
filtrod 2.1.0

wp_handle_upload

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

Opis — z kodu źródłowego

Filters the data array for the uploaded file.

Parametry

ParametrTypOpis
$uploadarray{ Array of upload data. @type string $file Filename of the newly-uploaded file. @type string $url URL of the newly-uploaded file. @type string $type Mime type of the newly-uploaded file. }
$contextstringThe type of upload action. Values include 'upload' or 'sideload'.

Wywołanie

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

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

Popularne w tej kategorii