Filters the decoding attribute value to add to an image. Default async.
Description
Returning a falsey value will omit the attribute.
Parameters
$valuestring|false|null- The
decodingattribute value. Returning a falsey value will result in the attribute being omitted for the image.
Otherwise, it may be:'async','sync', or'auto'. Defaults to false. $imagestring- The HTML
imgtag to be filtered. $contextstring- Additional context about how the function was called or where the img tag is.
Source
if ( ! apply_filters( 'wp_img_tag_add_auto_sizes', true ) ) {
return $image;
}
$processor = new WP_HTML_Tag_Processor( $image );
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.