Ticket #22784: 22784.diff
| File 22784.diff, 1.4 KB (added by Caspie, 6 months ago) |
|---|
-
wp-includes/media.php
27 27 * @since 2.5.0 28 28 * @uses wp_constrain_dimensions() This function passes the widths and the heights. 29 29 * 30 * @param int $width Width of the image 31 * @param int $height Height of the image 30 * @param int $width Width of the image. 31 * @param int $height Height of the image. 32 32 * @param string|array $size Size of what the result image should be. 33 * @param context Could be 'display' (like in a theme) or 'edit' (like inserting into a neditor)33 * @param string $context Optional. Could be 'display' (like in a theme) or 'edit' (like inserting into an editor). 34 34 * @return array Width and height of what the result image should resize to. 35 35 */ 36 function image_constrain_size_for_editor( $width, $height, $size = 'medium', $context = null ) {36 function image_constrain_size_for_editor( $width, $height, $size = 'medium', $context = null ) { 37 37 global $content_width, $_wp_additional_image_sizes; 38 38 39 39 if ( ! $context ) … … 170 170 $height = $meta['height']; 171 171 } 172 172 173 if ( $img_url ) {173 if ( $img_url ) { 174 174 // we have the actual image size, but might need to further constrain it if content_width is narrower 175 175 list( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size ); 176 176
