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
This commit is contained in:
parent
270f2011f8
commit
8f6ed34331
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue