diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index a5d41ccc18..219eb0ab29 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -506,6 +506,10 @@ function populate_options() { // 4.3.0 'finished_splitting_shared_terms' => 1, 'site_icon' => 0, + + // 4.4.0 + 'medium_large_size_w' => 768, + 'medium_large_size_h' => 0, ); // 3.3 diff --git a/wp-admin/options.php b/wp-admin/options.php index ade59cbbb2..df6f0a5af1 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -84,7 +84,7 @@ if ( is_multisite() && ! is_super_admin() && 'update' != $action ) { $whitelist_options = array( 'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'timezone_string', 'WPLANG' ), 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), - 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), + 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'medium_large_size_w', 'medium_large_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ), 'writing' => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format' ) ); diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 9951dba0a5..2093c6b462 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -212,7 +212,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { * @access public * * @param array $sizes { - * An array of image size arrays. Default sizes are 'small', 'medium', 'large'. + * An array of image size arrays. Default sizes are 'small', 'medium', 'medium_large', 'large'. * * Either a height or width must be provided. * If one of the two is set to null, the resize will diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 58338055e2..a14fa40657 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -270,7 +270,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @access public * * @param array $sizes { - * An array of image size arrays. Default sizes are 'small', 'medium', 'large'. + * An array of image size arrays. Default sizes are 'small', 'medium', 'medium_large', 'large'. * * Either a height or width must be provided. * If one of the two is set to null, the resize will diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index bf6c7b1cb5..08897dc032 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -513,6 +513,16 @@ class wp_xmlrpc_server extends IXR_Server { 'readonly' => false, 'option' => 'medium_size_h' ), + 'medium_large_size_w' => array( + 'desc' => __( 'Medium-Large size image width' ), + 'readonly' => false, + 'option' => 'medium_large_size_w' + ), + 'medium_large_size_h' => array( + 'desc' => __( 'Medium-Large size image height' ), + 'readonly' => false, + 'option' => 'medium_large_size_h' + ), 'large_size_w' => array( 'desc' => __( 'Large size image width' ), 'readonly' => false, diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index bf9a50d2a7..51947283bd 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3662,6 +3662,8 @@ function sanitize_option( $option, $value ) { case 'thumbnail_size_h': case 'medium_size_w': case 'medium_size_h': + case 'medium_large_size_w': + case 'medium_large_size_h': case 'large_size_w': case 'large_size_h': case 'mailserver_port': diff --git a/wp-includes/media.php b/wp-includes/media.php index 0ba67a9370..4b0126a998 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -14,7 +14,7 @@ * The `$size` parameter accepts either an array or a string. The supported string * values are 'thumb' or 'thumbnail' for the given thumbnail size or defaults at * 128 width and 96 height in pixels. Also supported for the string value is - * 'medium' and 'full'. The 'full' isn't actually supported, but any value other + * 'medium', 'medium_large' and 'full'. The 'full' isn't actually supported, but any value other * than the supported will result in the content_width size or 500 if that is * not set. * @@ -60,7 +60,15 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co elseif ( $size == 'medium' ) { $max_width = intval(get_option('medium_size_w')); $max_height = intval(get_option('medium_size_h')); - // if no width is set, default to the theme content width if available + + } + elseif ( $size == 'medium_large' ) { + $max_width = intval( get_option( 'medium_large_size_w' ) ); + $max_height = intval( get_option( 'medium_large_size_h' ) ); + + if ( intval( $content_width ) > 0 ) { + $max_width = min( intval( $content_width ), $max_width ); + } } elseif ( $size == 'large' ) { /* @@ -71,8 +79,9 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co */ $max_width = intval(get_option('large_size_w')); $max_height = intval(get_option('large_size_h')); - if ( intval($content_width) > 0 ) + if ( intval($content_width) > 0 ) { $max_width = min( intval($content_width), $max_width ); + } } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) { $max_width = intval( $_wp_additional_image_sizes[$size]['width'] ); $max_height = intval( $_wp_additional_image_sizes[$size]['height'] ); @@ -706,7 +715,7 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { */ function get_intermediate_image_sizes() { global $_wp_additional_image_sizes; - $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes + $image_sizes = array('thumbnail', 'medium', 'medium_large', 'large'); // Standard sizes if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) ); @@ -716,7 +725,7 @@ function get_intermediate_image_sizes() { * @since 2.5.0 * * @param array $image_sizes An array of intermediate image sizes. Defaults - * are 'thumbnail', 'medium', 'large'. + * are 'thumbnail', 'medium', 'medium_large', 'large'. */ return apply_filters( 'intermediate_image_sizes', $image_sizes ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5ea9b6cf67..52fd8e088e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,14 +4,14 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta2-35478'; +$wp_version = '4.4-beta2-35479'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ -$wp_db_version = 35329; +$wp_db_version = 35465; /** * Holds the TinyMCE version