WP HOOKS
filtrod 4.5.0

wp_unique_filename

Args 6Plik wp-includes/functions.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the result when generating a unique file name.

Parametry

ParametrTypOpis
$filenamestringUnique file name.
$extstringFile extension. Example: ".png".
$dirstringDirectory path.
$unique_filename_callbackcallable | nullCallback function that generates the unique file name.
$alt_filenamesstring[]Array of alternate file names that were checked for collisions.
$numberint | stringThe highest number that was used to make the file name unique or an empty string if unused.

Wywołanie

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

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

Popularne w tej kategorii