WordPress.org

Make WordPress Core

Ticket #22784: 22784.diff

File 22784.diff, 1.4 KB (added by Caspie, 17 months ago)
  • wp-includes/media.php

     
    2727 * @since 2.5.0 
    2828 * @uses wp_constrain_dimensions() This function passes the widths and the heights. 
    2929 * 
    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. 
    3232 * @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). 
    3434 * @return array Width and height of what the result image should resize to. 
    3535 */ 
    36 function image_constrain_size_for_editor($width, $height, $size = 'medium', $context = null ) { 
     36function image_constrain_size_for_editor( $width, $height, $size = 'medium', $context = null ) { 
    3737        global $content_width, $_wp_additional_image_sizes; 
    3838 
    3939        if ( ! $context ) 
     
    170170                $height = $meta['height']; 
    171171        } 
    172172 
    173         if ( $img_url) { 
     173        if ( $img_url ) { 
    174174                // we have the actual image size, but might need to further constrain it if content_width is narrower 
    175175                list( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size ); 
    176176