# gutenberg/24.1.0/lib/experimental/editor-settings.php

Gutenberg, version 24.1.0. 63 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/24.1.0/code/lib/experimental/editor-settings.php
- Raw: https://pluginprobe.com/plugins/gutenberg/24.1.0/raw/lib/experimental/editor-settings.php
- Modified: 2026-09-16T10:39:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/24.1.0/code/lib/experimental/editor-settings.php#L10-L20`.

```php
<?php
/**
 * Utilities to manage editor settings.
 *
 * @package gutenberg
 */

/**
 * Sets a global JS variable used to trigger the availability of each Gutenberg Experiment.
 */
function gutenberg_enable_experiments() {
	global $pagenow;

	if ( gutenberg_is_experiment_enabled( 'gutenberg-grid-interactivity' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableGridInteractivity = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-global-styles-inheritance-ui' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalGlobalStylesInheritanceUI = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-dataviews-media-modal' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDataViewsMediaModal = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-extensible-site-editor' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalExtensibleSiteEditor = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-dataform-inspector' ) ) {
		wp_add_inline_script( 'wp-editor', 'window.__experimentalDataFormInspector = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-media-editor' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalMediaEditor = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-dashboard-widgets' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalDashboardWidgets = true', 'before' );
	}
	if ( gutenberg_is_experiment_enabled( 'gutenberg-real-time-collaboration' ) ) {
		$collaboration_enabled = ! (
			'site-editor.php' === $pagenow ||
			( 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'site-editor-v2' === $_GET['page'] )
		);

		wp_add_inline_script(
			'wp-core-data',
			'window.__experimentalEnableRealTimeCollaboration = ' . wp_json_encode( $collaboration_enabled ) . ';',
			'before'
		);
	}
}

add_action( 'admin_init', 'gutenberg_enable_experiments' );
add_action( 'site-editor-v2_init', 'gutenberg_enable_experiments' );

/**
 * Sets global JS variables used to enable various block experiments.
 */
function gutenberg_enable_block_experiments() {
	// General experimental blocks that are not in the default block library.
	if ( gutenberg_is_experiment_enabled( 'gutenberg-block-experiments' ) ) {
		wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockExperiments = true', 'before' );
	}
}

add_action( 'admin_init', 'gutenberg_enable_block_experiments' );

```
