From 8f6ed34331593382a7a4b70dd047bb25128369c2 Mon Sep 17 00:00:00 2001 From: gziolo Date: Wed, 24 Mar 2021 07:33:08 +0000 Subject: [PATCH] Editor: Add image default size to block editor settings Related: https://github.com/WordPress/gutenberg/pull/29966 Add new imageDefaultSize value to block editor settings. Props Mamaduka. Fixes #52896. Built from https://develop.svn.wordpress.org/trunk@50570 git-svn-id: http://core.svn.wordpress.org/trunk@50183 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-blocks.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index bc198de8b7..5ce8fba395 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -250,6 +250,9 @@ foreach ( $image_size_names as $image_size_slug => $image_size_name ) { ); } +$default_size = get_option( 'image_default_size', 'large' ); +$image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $image_default_size : 'large'; + $image_dimensions = array(); $all_sizes = wp_get_registered_image_subsizes(); foreach ( $available_image_sizes as $size ) { @@ -323,6 +326,7 @@ $editor_settings = array( 'styles' => $styles, 'defaultEditorStyles' => $default_editor_styles, 'imageSizes' => $available_image_sizes, + 'imageDefaultSize' => $image_default_size, 'imageDimensions' => $image_dimensions, 'richEditingEnabled' => user_can_richedit(), 'postLock' => $lock_details, diff --git a/wp-includes/version.php b/wp-includes/version.php index d2aa8d0322..bb936d9b45 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50569'; +$wp_version = '5.8-alpha-50570'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.