WP HOOKS
filtrod 4.3.0

wp_get_attachment_image_src

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

Opis — z kodu źródłowego

Filters the attachment image source result.

Parametry

ParametrTypOpis
$imagearray | false{ Array of image data, or boolean false if no image is available. @type string $0 Image source URL. @type int $1 Image width in pixels. @type int $2 Image height in pixels. @type bool $3 Whether the image is a resized image. }
$attachment_idintImage attachment ID.
$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).
$iconboolWhether the image should be treated as an icon.

Wywołanie

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

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

Popularne w tej kategorii