WordPress at a glance
filter is not described

wp_img_tag_add_loading_attr filter-hook . WP 5.5.0

Filters the loading attribute value. Default lazy.

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


add_filter( 'wp_img_tag_add_loading_attr', 'filter_function_name_5873', 10, 3 );
function filter_function_name_5873( $value, $image, $context ){
	// filter...

	return $value;
The loading attribute value. Returning a falsey value will result in the attribute being omitted for the image.
Default: lazy
The HTML img tag to be filtered.
Additional context about how the function was called or where the img tag is.

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

wp-includes/media.php 1824
$value = apply_filters( 'wp_img_tag_add_loading_attr', 'lazy', $image, $context );

Где используется хук в ядре WP

Использование не найдено.