apply_filters( 'wp_img_tag_add_loading_attr', string|bool $value, string $image, string $context )

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

Description Description

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

Top ↑

Parameters Parameters


(string|bool) The loading attribute value. Returning a falsey value will result in the attribute being omitted for the image. Default 'lazy'.


(string) The HTML img tag to be filtered.


(string) Additional context about how the function was called or where the img tag is.

Top ↑

Source Source

File: wp-includes/media.php

View on Trac

Top ↑

Changelog Changelog

Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

Top ↑

You must log in before being able to contribute a note or feedback.