mirror of
git://develop.git.wordpress.org/
synced 2025-04-04 12:12:41 +02:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@50570 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bcdbedff60
commit
2382765afa
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user