Changeset 57294
- Timestamp:
- 01/16/2024 05:01:30 PM (13 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r57263 r57294 2118 2118 2119 2119 if ( $size_array ) { 2120 // If the width is enforced through style (e.g. in an inline image), calculate the dimension attributes. 2121 $style_width = preg_match( '/style="width:\s*(\d+)px;"/', $image, $match_width ) ? (int) $match_width[1] : 0; 2122 if ( $style_width ) { 2123 $size_array[1] = (int) round( $size_array[1] * $style_width / $size_array[0] ); 2124 $size_array[0] = $style_width; 2125 } 2126 2120 2127 $hw = trim( image_hwstring( $size_array[0], $size_array[1] ) ); 2121 2128 return str_replace( '<img', "<img {$hw}", $image );
Note: See TracChangeset
for help on using the changeset viewer.