Skip to content

Commit

Permalink
Remove the experiment option (WordPress#50983)
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr authored and sethrubenstein committed Jul 13, 2023
1 parent 7f46895 commit 64c82e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
25 changes: 11 additions & 14 deletions lib/compat/wordpress-6.3/theme-previews.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,15 @@ function block_theme_activate_nonce() {
<?php
}

// Hide this feature behind an experiment.
$gutenberg_experiments = get_option( 'gutenberg-experiments' );
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-theme-previews', $gutenberg_experiments ) ) {
/**
* Attaches filters to enable theme previews in the Site Editor.
*/
if ( ! empty( $_GET['gutenberg_theme_preview'] ) ) {
add_filter( 'stylesheet', 'gutenberg_get_theme_preview_path' );
add_filter( 'template', 'gutenberg_get_theme_preview_path' );
add_filter( 'init', 'gutenberg_attach_theme_preview_middleware' );
}

add_action( 'admin_head', 'block_theme_activate_nonce' );
add_action( 'admin_print_footer_scripts', 'add_live_preview_button', 11 );
/**
* Attaches filters to enable theme previews in the Site Editor.
*/
if ( ! empty( $_GET['gutenberg_theme_preview'] ) ) {
add_filter( 'stylesheet', 'gutenberg_get_theme_preview_path' );
add_filter( 'template', 'gutenberg_get_theme_preview_path' );
add_filter( 'init', 'gutenberg_attach_theme_preview_middleware' );
}

add_action( 'admin_head', 'block_theme_activate_nonce' );
add_action( 'admin_print_footer_scripts', 'add_live_preview_button', 11 );

8 changes: 4 additions & 4 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ function gutenberg_initialize_experiments_settings() {
);

add_settings_field(
'gutenberg-theme-previews',
__( 'Block Theme Previews', 'gutenberg' ),
'gutenberg-details-blocks',
__( 'Details block', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable Block Theme Previews', 'gutenberg' ),
'id' => 'gutenberg-theme-previews',
'label' => __( 'Test the Details block', 'gutenberg' ),
'id' => 'gutenberg-details-blocks',
)
);

Expand Down

0 comments on commit 64c82e5

Please sign in to comment.