Update mobile block editor settings to use Gallery block v2 for WordPress 5.9+ #50569
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Attempts to fix an issue where users on WordPress 5.9+ receive the wrong version of the Gallery block.
Related issues:
galleryWithImageBlocks
prop value based on the WordPress version of the site when value is unknown #47782Why?
When a self-hosted site is using WordPress 5.9+ and the Gutenberg plugin is not installed, the Gallery block defaults to v1. This is due to the prop
galleryWithImageBlocks
being unknown.How?
In the mobile block editor settings, the list and quote blocks are instructed to use v2 versions. This PR introduces a similar instruction for the Gallery block for sites using WP 5.9+. (This technique was also used when the Gallery block v1 was temporarily deprecated, which has since been reverted.)
Caveat: I noted that as this code is in
lib/experiments
, it may not be available to users without the Gutenberg plugin installed, which is the group that would benefit the most from this change. However, perhaps this PR could be a starting point for how we leverage a similar technique to provide either the WP version number or thegalleryWithImageBlocks
flag itself to users without the plugin installed.Testing Instructions