PluginProbe
Gutenberg / 14.5.2
Gutenberg v14.5.2
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | lib/experimental/block-editor-settings-mobile.php +17 -8 23.3.1 → 14.5.2 View file →
@@ -15,16 +15,25 @@
15 15 *
16 16 * @return array New block editor settings.
17 17 */
18 18 function gutenberg_get_block_editor_settings_mobile( $settings ) {
19 - if ( wp_theme_has_theme_json() ) {
20 - $settings['__experimentalStyles'] = gutenberg_get_global_styles();
19 + if (
20 + defined( 'REST_REQUEST' ) &&
21 + REST_REQUEST &&
22 + isset( $_GET['context'] ) &&
23 + 'mobile' === $_GET['context']
24 + ) {
25 + if ( wp_theme_has_theme_json() ) {
26 + $settings['__experimentalStyles'] = gutenberg_get_global_styles();
27 + }
28 +
29 + // To tell mobile that the site uses quote v2 (inner blocks).
30 + // See https://github.com/WordPress/gutenberg/pull/25892.
31 + $settings['__experimentalEnableQuoteBlockV2'] = true;
32 + // To tell mobile that the site uses list v2 (inner blocks).
33 + $settings['__experimentalEnableListBlockV2'] = true;
21 34 }
22 35
23 - // To tell mobile that the site uses quote v2 (inner blocks).
24 - // See https://github.com/WordPress/gutenberg/pull/25892.
25 - $settings['__experimentalEnableQuoteBlockV2'] = true;
26 - // To tell mobile that the site uses list v2 (inner blocks).
27 - $settings['__experimentalEnableListBlockV2'] = true;
28 -
29 36 return $settings;
30 37 }
38 +
39 +add_filter( 'block_editor_settings_all', 'gutenberg_get_block_editor_settings_mobile', PHP_INT_MAX );