filtrod 5.3.0
big_image_size_threshold
Opis — z kodu źródłowego
Filters the "BIG image" threshold value.
If the original image width or height is above the threshold, it will be scaled down. The threshold is used as max width and max height. The scaled down image will be used as the largest available size, including the _wp_attached_file post meta value.
Returning false from the filter callback will disable the scaling.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$threshold | int | The threshold value in pixels. Default 2560. |
$imagesize | array | { Indexed array of the image width and height in pixels. @type int $0 The image width. @type int $1 The image height. } |
$file | string | Full path to the uploaded image file. |
$attachment_id | int | Attachment post ID. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'big_image_size_threshold', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'big_image_size_threshold', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii