Skip to content

Commit

Permalink
Revert "Adds experimental blocks flag for blocks that may not be read…
Browse files Browse the repository at this point in the history
…y for general use (#64121)"

This reverts commit ff59ffa.
  • Loading branch information
t-hamano committed Aug 7, 2024
1 parent 59fd812 commit 55bb59b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
18 changes: 1 addition & 17 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,12 @@ function gutenberg_enable_experiments() {

/**
* Sets a global JS variable used to trigger the availability of form & input blocks.
*
* @deprecated 19.0.0 Use gutenberg_enable_block_experiments().
*/
function gutenberg_enable_form_input_blocks() {
_deprecated_function( __FUNCTION__, 'Gutenberg 19.0.0', 'gutenberg_enable_block_experiments' );
}

/**
* Sets global JS variables used to enable various block experiments.
*/
function gutenberg_enable_block_experiments() {
$gutenberg_experiments = get_option( 'gutenberg-experiments' );

// Experimental form blocks.
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-form-blocks', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableFormBlocks = true', 'before' );
}

// General experimental blocks that are not in the default block library.
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-experiments', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockExperiments = true', 'before' );
}
}

add_action( 'admin_init', 'gutenberg_enable_block_experiments' );
add_action( 'admin_init', 'gutenberg_enable_form_input_blocks' );
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-block-experiments',
__( 'Experimental blocks', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable experimental blocks.<p class="description">(Warning: these blocks may have significant changes during development that cause validation errors and display issues.)</p>', 'gutenberg' ),
'id' => 'gutenberg-block-experiments',
)
);

add_settings_field(
'gutenberg-form-blocks',
__( 'Form and input blocks ', 'gutenberg' ),
Expand Down
1 change: 0 additions & 1 deletion phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function fail_if_died( $message ) {
'gutenberg-widget-experiments' => '1',
'gutenberg-full-site-editing' => 1,
'gutenberg-form-blocks' => 1,
'gutenberg-block-experiments' => 1,
),
);

Expand Down

0 comments on commit 55bb59b

Please sign in to comment.