WP HOOKS
filtrod 5.5.0

wp_img_tag_add_loading_attr

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

Opis — z kodu źródłowego

Filters the `loading` attribute value to add to an image. Default `lazy`.

Returning false or an empty string will not add the attribute. Returning true will add the default value.

Parametry

ParametrTypOpis
$valuestring | boolThe <code>loading</code> attribute value. Returning a falsey value will result in the attribute being omitted for the image.
$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_loading_attr', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii