Changeset 53481 for trunk/src/wp-includes/media.php
- Timestamp:
- 06/09/2022 04:19:39 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r53480 r53481 1004 1004 * @since 4.4.0 The `$srcset` and `$sizes` attributes were added. 1005 1005 * @since 5.5.0 The `$loading` attribute was added. 1006 * @since 6.1.0 The `$decoding` attribute was added. 1006 1007 * 1007 1008 * @param int $attachment_id Image attachment ID. … … 1944 1945 1945 1946 /** 1946 * Add `decoding` attribute to an `img` HTML tag.1947 * Adds `decoding` attribute to an `img` HTML tag. 1947 1948 * 1948 1949 * The `decoding` attribute allows developers to indicate whether the … … 1969 1970 * @since 6.1.0 1970 1971 * 1971 * @param string|false|null $value The `decoding` attribute value. Returning a falsey value will result in1972 * the attribute being omitted for the image. Otherwise, it may be:1973 * 'async' (default), 'sync', or 'auto'.1972 * @param string|false|null $value The `decoding` attribute value. Returning a falsey value 1973 * will result in the attribute being omitted for the image. 1974 * Otherwise, it may be: 'async' (default), 'sync', or 'auto'. 1974 1975 * @param string $image The HTML `img` tag to be filtered. 1975 * @param string $context Additional context about how the function was called or where the img tag is. 1976 * @param string $context Additional context about how the function was called 1977 * or where the img tag is. 1976 1978 */ 1977 1979 $value = apply_filters( 'wp_img_tag_add_decoding_attr', 'async', $image, $context ); 1980 1978 1981 if ( in_array( $value, array( 'async', 'sync', 'auto' ), true ) ) { 1979 1982 $image = str_replace( '<img ', '<img decoding="' . esc_attr( $value ) . '" ', $image );
Note: See TracChangeset
for help on using the changeset viewer.