From 7ffc7c29cc5f0d1f9da1c7ec9b9bb303d3c9815e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 9 Dec 2021 15:25:01 +0000 Subject: [PATCH] Editor: Add an editor settings flag to enable the new gallery for mobile apps for 5.9. Currently the WordPress mobile apps rely on the `__unstableGalleryWithImageBlocks` flag being set in order to enable the new gallery block format. This commit includes the value in the `get_default_block_editor_settings()` function in order to ensure that versions of the mobile app >= 18.2 will be able to add and edit gallery blocks in the new format. Props glendaviesnz, ocean90, hellofromTonya, noisysocks. Fixes #54583. Built from https://develop.svn.wordpress.org/trunk@52349 git-svn-id: http://core.svn.wordpress.org/trunk@51941 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-editor.php | 36 +++++++++++++++++++----------------- wp-includes/version.php | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index 0c8dc72ed9..7205ef2f4a 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -201,23 +201,25 @@ function get_default_block_editor_settings() { } $editor_settings = array( - 'alignWide' => get_theme_support( 'align-wide' ), - 'allowedBlockTypes' => true, - 'allowedMimeTypes' => get_allowed_mime_types(), - 'defaultEditorStyles' => $default_editor_styles, - 'blockCategories' => get_default_block_categories(), - 'disableCustomColors' => get_theme_support( 'disable-custom-colors' ), - 'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ), - 'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ), - 'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ), - 'enableCustomSpacing' => get_theme_support( 'custom-spacing' ), - 'enableCustomUnits' => get_theme_support( 'custom-units' ), - 'isRTL' => is_rtl(), - 'imageDefaultSize' => $image_default_size, - 'imageDimensions' => $image_dimensions, - 'imageEditing' => true, - 'imageSizes' => $available_image_sizes, - 'maxUploadFileSize' => $max_upload_size, + 'alignWide' => get_theme_support( 'align-wide' ), + 'allowedBlockTypes' => true, + 'allowedMimeTypes' => get_allowed_mime_types(), + 'defaultEditorStyles' => $default_editor_styles, + 'blockCategories' => get_default_block_categories(), + 'disableCustomColors' => get_theme_support( 'disable-custom-colors' ), + 'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ), + 'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ), + 'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ), + 'enableCustomSpacing' => get_theme_support( 'custom-spacing' ), + 'enableCustomUnits' => get_theme_support( 'custom-units' ), + 'isRTL' => is_rtl(), + 'imageDefaultSize' => $image_default_size, + 'imageDimensions' => $image_dimensions, + 'imageEditing' => true, + 'imageSizes' => $available_image_sizes, + 'maxUploadFileSize' => $max_upload_size, + // The following flag is required to enable the new Gallery block format on the mobile apps in 5.9. + '__unstableGalleryWithImageBlocks' => true, ); // Theme settings. diff --git a/wp-includes/version.php b/wp-includes/version.php index 760ed7f922..e688d43bbd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta2-52348'; +$wp_version = '5.9-beta2-52349'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.