diff --git src/wp-includes/media.php src/wp-includes/media.php
index 7b99f95..5e73344 100644
|
|
function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co |
42 | 42 | global $content_width, $_wp_additional_image_sizes; |
43 | 43 | |
44 | 44 | if ( ! $context ) |
45 | | $context = is_admin() ? 'edit' : 'display'; |
| 45 | $context = ( is_admin() && ! defined( 'DOING_AJAX' ) ) ? 'edit' : 'display'; |
46 | 46 | |
47 | 47 | if ( is_array($size) ) { |
48 | 48 | $max_width = $size[0]; |
… |
… |
function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co |
79 | 79 | */ |
80 | 80 | $max_width = intval(get_option('large_size_w')); |
81 | 81 | $max_height = intval(get_option('large_size_h')); |
82 | | if ( intval($content_width) > 0 ) { |
| 82 | if ( intval($content_width) > 0 && 'edit' === $context ) { |
83 | 83 | $max_width = min( intval($content_width), $max_width ); |
84 | 84 | } |
85 | 85 | } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) { |