PluginProbe
Gutenberg / 13.7.2
Gutenberg v13.7.2
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 7.4.0 All 402 releases
gutenberg / lib / experimental / block-editor-settings-mobile.php

block-editor-settings-mobile.php in Gutenberg 13.7.2, at lib/experimental/block-editor-settings-mobile.php

38 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Adds settings to the mobile block editor.
4 *
5 * @package gutenberg
6 */
7
8 /**
9 * Adds settings to the mobile block editor.
10 *
11 * This is used by the settings REST endpoint and it should land in core
12 * as soon as lib/class-wp-rest-block-editor-settings-controller.php does.
13 *
14 * @param array $settings Existing block editor settings.
15 *
16 * @return array New block editor settings.
17 */
18 function gutenberg_get_block_editor_settings_mobile( $settings ) {
19 if (
20 defined( 'REST_REQUEST' ) &&
21 REST_REQUEST &&
22 isset( $_GET['context'] ) &&
23 'mobile' === $_GET['context']
24 ) {
25 if ( WP_Theme_JSON_Resolver_Gutenberg::theme_has_support() ) {
26 $settings['__experimentalStyles'] = gutenberg_get_global_styles();
27 }
28
29 // To be set to true when the web makes quote v2 (inner blocks) the default.
30 // See https://github.com/WordPress/gutenberg/pull/25892.
31 $settings['__experimentalEnableQuoteBlockV2'] = gutenberg_is_quote_v2_enabled();
32 }
33
34 return $settings;
35 }
36
37 add_filter( 'block_editor_settings_all', 'gutenberg_get_block_editor_settings_mobile', PHP_INT_MAX );
38