A WordPress-centric search engine for devs and theme authors



wp_img_tag_add_loading_attr ›

Since5.5.0
Deprecatedn/a
apply_filters( 'wp_img_tag_add_loading_attr', 'lazy', $image, $context )
Parameters: (3)
  • (string|bool) $value The `loading` attribute value. Returning a falsey value will result in the attribute being omitted for the image. Default is `lazy`.
    Required: Yes
  • (string) $image The HTML `img` tag to be filtered.
    Required: Yes
  • (string) $context Additional context about how the function was called or where the img tag is.
    Required: Yes
Defined at:
Codex:

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.





Source

$value = apply_filters( 'wp_img_tag_add_loading_attr', 'lazy', $image, $context );