filtrod 4.5.0
wp_unique_filename
Opis — z kodu źródłowego
Filters the result when generating a unique file name.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$filename | string | Unique file name. |
$ext | string | File extension. Example: ".png". |
$dir | string | Directory path. |
$unique_filename_callback | callable | null | Callback function that generates the unique file name. |
$alt_filenames | string[] | Array of alternate file names that were checked for collisions. |
$number | int | string | The 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
}
// 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