PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 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 All 404 releases
← All changes | lib/experimental/editor-settings.php +16 -25 23.4.0 → 24.1.0 View file →
@@ -8,23 +8,19 @@
8 8 /**
9 9 * Sets a global JS variable used to trigger the availability of each Gutenberg Experiment.
10 10 */
11 11 function gutenberg_enable_experiments() {
12 - if ( gutenberg_is_experiment_enabled( 'gutenberg-color-randomizer' ) ) {
13 - wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableColorRandomizer = true', 'before' );
14 - }
12 + global $pagenow;
13 +
15 14 if ( gutenberg_is_experiment_enabled( 'gutenberg-grid-interactivity' ) ) {
16 15 wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableGridInteractivity = true', 'before' );
17 16 }
17 + if ( gutenberg_is_experiment_enabled( 'gutenberg-global-styles-inheritance-ui' ) ) {
18 + wp_add_inline_script( 'wp-block-editor', 'window.__experimentalGlobalStylesInheritanceUI = true', 'before' );
19 + }
18 20 if ( gutenberg_is_experiment_enabled( 'gutenberg-dataviews-media-modal' ) ) {
19 21 wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDataViewsMediaModal = true', 'before' );
20 22 }
21 - if ( gutenberg_is_experiment_enabled( 'gutenberg-content-only-inspector-fields' ) ) {
22 - wp_add_inline_script( 'wp-block-editor', 'window.__experimentalContentOnlyInspectorFields = true', 'before' );
23 - }
24 - if ( gutenberg_is_experiment_enabled( 'active_templates' ) ) {
25 - wp_add_inline_script( 'wp-block-editor', 'window.__experimentalTemplateActivate = true', 'before' );
26 - }
27 23 if ( gutenberg_is_experiment_enabled( 'gutenberg-extensible-site-editor' ) ) {
28 24 wp_add_inline_script( 'wp-block-editor', 'window.__experimentalExtensibleSiteEditor = true', 'before' );
29 25 }
30 26 if ( gutenberg_is_experiment_enabled( 'gutenberg-dataform-inspector' ) ) {
@@ -35,10 +31,19 @@
35 31 }
36 32 if ( gutenberg_is_experiment_enabled( 'gutenberg-dashboard-widgets' ) ) {
37 33 wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDashboardWidgets = true', 'before' );
38 34 }
39 - if ( gutenberg_is_experiment_enabled( 'gutenberg-classic-block-deprecation' ) ) {
40 - wp_add_inline_script( 'wp-block-library', 'window.__experimentalClassicBlockDeprecation = true', 'before' );
35 + if ( gutenberg_is_experiment_enabled( 'gutenberg-real-time-collaboration' ) ) {
36 + $collaboration_enabled = ! (
37 + 'site-editor.php' === $pagenow ||
38 + ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'site-editor-v2' === $_GET['page'] )
39 + );
40 +
41 + wp_add_inline_script(
42 + 'wp-core-data',
43 + 'window.__experimentalEnableRealTimeCollaboration = ' . wp_json_encode( $collaboration_enabled ) . ';',
44 + 'before'
45 + );
41 46 }
42 47 }
43 48
44 49 add_action( 'admin_init', 'gutenberg_enable_experiments' );
@@ -44,25 +49,11 @@
44 49 add_action( 'admin_init', 'gutenberg_enable_experiments' );
45 50 add_action( 'site-editor-v2_init', 'gutenberg_enable_experiments' );
46 51
47 52 /**
48 - * Sets a global JS variable used to trigger the availability of form & input blocks.
49 - *
50 - * @deprecated 19.0.0 Use gutenberg_enable_block_experiments().
51 - */
52 -function gutenberg_enable_form_input_blocks() {
53 - _deprecated_function( __FUNCTION__, 'Gutenberg 19.0.0', 'gutenberg_enable_block_experiments' );
54 -}
55 -
56 -/**
57 53 * Sets global JS variables used to enable various block experiments.
58 54 */
59 55 function gutenberg_enable_block_experiments() {
60 - // Experimental form blocks.
61 - if ( gutenberg_is_experiment_enabled( 'gutenberg-form-blocks' ) ) {
62 - wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableFormBlocks = true', 'before' );
63 - }
64 -
65 56 // General experimental blocks that are not in the default block library.
66 57 if ( gutenberg_is_experiment_enabled( 'gutenberg-block-experiments' ) ) {
67 58 wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockExperiments = true', 'before' );
68 59 }