Changeset 60420 for branches/6.8/src/wp-includes/media.php
- Timestamp:
- 07/07/2025 05:07:55 PM (7 months ago)
- Location:
- branches/6.8
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/media.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.8
-
branches/6.8/src/wp-includes/media.php
r59987 r60420 1071 1071 1072 1072 $attachment = get_post( $attachment_id ); 1073 $hwstring = image_hwstring( $width, $height );1074 1073 $size_class = $size; 1075 1074 … … 1091 1090 * @param string $context The context. Default 'wp_get_attachment_image'. 1092 1091 */ 1093 $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' ); 1094 $attr = wp_parse_args( $attr, $default_attr ); 1095 1096 $loading_attr = $attr; 1097 $loading_attr['width'] = $width; 1098 $loading_attr['height'] = $height; 1092 $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' ); 1093 $attr = wp_parse_args( $attr, $default_attr ); 1094 $attr['width'] = $width; 1095 $attr['height'] = $height; 1096 1099 1097 $loading_optimization_attr = wp_get_loading_optimization_attributes( 1100 1098 'img', 1101 $ loading_attr,1099 $attr, 1102 1100 $context 1103 1101 ); … … 1170 1168 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); 1171 1169 1172 $attr = array_map( 'esc_attr', $attr ); 1173 $html = rtrim( "<img $hwstring" ); 1170 if ( isset( $attr['height'] ) && is_numeric( $attr['height'] ) ) { 1171 $height = absint( $attr['height'] ); 1172 } 1173 if ( isset( $attr['width'] ) && is_numeric( $attr['width'] ) ) { 1174 $width = absint( $attr['width'] ); 1175 } 1176 unset( $attr['height'], $attr['width'] ); 1177 $attr = array_map( 'esc_attr', $attr ); 1178 $hwstring = image_hwstring( $width, $height ); 1179 $html = rtrim( "<img $hwstring" ); 1174 1180 1175 1181 foreach ( $attr as $name => $value ) {
Note: See TracChangeset
for help on using the changeset viewer.