Changeset 52065 for trunk/src/wp-includes/post-thumbnail-template.php
- Timestamp:
- 11/09/2021 12:34:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-thumbnail-template.php
r52028 r52065 187 187 } 188 188 189 // Get the 'loading' attribute value to use as default, taking precedence over the default from 190 // `wp_get_attachment_image()`. 191 $loading = wp_get_loading_attr_default( 'the_post_thumbnail' ); 192 193 // Add the default to the given attributes unless they already include a 'loading' directive. 194 if ( empty( $attr ) ) { 195 $attr = array( 'loading' => $loading ); 196 } elseif ( is_array( $attr ) && ! array_key_exists( 'loading', $attr ) ) { 197 $attr['loading'] = $loading; 198 } elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=', $attr ) ) { 199 $attr .= '&loading=' . $loading; 200 } 201 189 202 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); 190 203
Note: See TracChangeset
for help on using the changeset viewer.