WP HOOKS
filtrod 4.4.0

wp_calculate_image_sizes

Args 5Plik wp-includes/media.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the output of 'wp_calculate_image_sizes()'.

Parametry

ParametrTypOpis
$sizesstringA source size value for use in a 'sizes' attribute.
$sizestring | int[]Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
$image_srcstring | nullThe URL to the image file or null.
$image_metaarray | nullThe image meta data as returned by wp_get_attachment_metadata() or null.
$attachment_idintImage attachment ID of the original image or 0.

Wywołanie

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

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

Popularne w tej kategorii