Changeset 48852 for trunk/src/wp-includes/media.php
- Timestamp:
- 08/24/2020 10:02:44 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r48798 r48852 1003 1003 * 1004 1004 * @since 2.5.0 1005 * @since 5.5.0 The `$loading` attribute was added. 1005 1006 * 1006 1007 * @param int $attachment_id Image attachment ID. … … 1011 1012 * Optional. Attributes for the image markup. 1012 1013 * 1013 * @type string $src Image attachment URL. 1014 * @type string $class CSS class name or space-separated list of classes. 1015 * Default `attachment-$size_class size-$size_class`, 1016 * where `$size_class` is the image size being requested. 1017 * @type string $alt Image description for the alt attribute. 1018 * @type string $srcset The 'srcset' attribute value. 1019 * @type string $sizes The 'sizes' attribute value. 1014 * @type string $src Image attachment URL. 1015 * @type string $class CSS class name or space-separated list of classes. 1016 * Default `attachment-$size_class size-$size_class`, 1017 * where `$size_class` is the image size being requested. 1018 * @type string $alt Image description for the alt attribute. 1019 * @type string $srcset The 'srcset' attribute value. 1020 * @type string $sizes The 'sizes' attribute value. 1021 * @type string|false $loading The 'loading' attribute value. Passing a value of false 1022 * will result in the attribute being omitted for the image. 1023 * Defaults to 'lazy', depending on wp_lazy_loading_enabled(). 1020 1024 * } 1021 1025 * @return string HTML img element or empty string on failure. … … 1049 1053 $attr = wp_parse_args( $attr, $default_attr ); 1050 1054 1051 // If `loading` attribute default of `lazy` is overridden for this1052 // image to omit the attribute, ensure it is not included.1055 // If the default value of `lazy` for the `loading` attribute is overridden 1056 // to omit the attribute for this image, ensure it is not included. 1053 1057 if ( array_key_exists( 'loading', $attr ) && ! $attr['loading'] ) { 1054 1058 unset( $attr['loading'] );
Note: See TracChangeset
for help on using the changeset viewer.