WP HOOKS
filtrod 5.5.0

pre_wp_unique_filename_file_list

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

Opis — z kodu źródłowego

Filters the file list used for calculating a unique filename for a newly added file.

Returning an array from the filter will effectively short-circuit retrieval from the filesystem and return the passed value instead.

Parametry

ParametrTypOpis
$filesarray | nullThe list of files to use for filename comparisons. Default null (to retrieve the list from the filesystem).
$dirstringThe directory for the new file.
$filenamestringThe proposed filename for the new file.

Wywołanie

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

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

Popularne w tej kategorii