WP HOOKS
filtrod 6.1.0

wp_img_tag_add_decoding_attr

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

Opis — z kodu źródłowego

Filters the `decoding` attribute value to add to an image. Default `async`.

Returning a falsey value will omit the attribute.

Parametry

ParametrTypOpis
$valuestring | false | nullThe <code>decoding</code> attribute value. Returning a falsey value will result in the attribute being omitted for the image. Otherwise, it may be: 'async', 'sync', or 'auto'. Defaults to false.
$imagestringThe HTML <code>img</code> tag to be filtered.
$contextstringAdditional context about how the function was called or where the img tag is.

Wywołanie

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

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

Popularne w tej kategorii