Filters the decoding
attribute value to add to an image. Default async
.
Description
Returning a falsey value will omit the attribute.
Parameters
$value
string|false|null- The
decoding
attribute 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. $image
string- The HTML
img
tag to be filtered. $context
string- Additional context about how the function was called or where the img tag is.
Source
if ( ! is_string( $sizes ) ) {
return $image;
}
// Don't add 'auto' to the sizes attribute if it already exists.
if ( wp_sizes_attribute_includes_valid_auto( $sizes ) ) {
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.