Ticket #34225: 34225.diff
File 34225.diff, 1.7 KB (added by , 8 years ago) |
---|
-
wp-includes/media.php
70 70 */ 71 71 $max_width = intval(get_option('large_size_w')); 72 72 $max_height = intval(get_option('large_size_h')); 73 if ( intval($content_width) > 0 )73 if ( intval($content_width) > 0 && 'edit' == $context ) { 74 74 $max_width = min( intval($content_width), $max_width ); 75 } 75 76 } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) { 76 77 $max_width = intval( $_wp_additional_image_sizes[$size]['width'] ); 77 78 $max_height = intval( $_wp_additional_image_sizes[$size]['height'] ); 78 if ( intval($content_width) > 0 && 'edit' == $context ) // Only in admin. Assume that theme authors know what they're doing. 79 // Only in admin. Assume that theme authors know what they're doing. 80 if ( intval($content_width) > 0 && 'edit' == $context ) { 79 81 $max_width = min( intval($content_width), $max_width ); 82 } 80 83 } 81 84 // $size == 'full' has no constraint 82 85 else { … … 2931 2934 2932 2935 // We have the actual image size, but might need to further constrain it if content_width is narrower. 2933 2936 // Thumbnail, medium, and full sizes are also checked against the site's height/width options. 2934 list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, ' edit' );2937 list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'info' ); 2935 2938 2936 2939 $sizes[ $size ] = array( 2937 2940 'height' => $height,