Filters the loading attribute value to add to an image. Default 'lazy'.
$valuestring|bool$imagestring$contextstringwp-includes/deprecated.php:4799wp_img_tag_add_loading_attr()wp-includes/media.php:2315wp_img_tag_add_loading_optimization_attrs() * * @param string|bool $value The `loading` attribute value. Returning a falsey value will result in * the attribute being omitted for the image. * @param string $image The HTML `img` tag to be filtered. * @param string $context Additional context about how the function was called or where the img tag is. */ $filtered_loading_attr = apply_filters( 'wp_img_tag_add_loading_attr', $optimization_attrs['loading'] ?? false, $image, $context );Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.