Skip to content

Commit

Permalink
Replace gallery experimental setting with a check for use_balanceTags
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Oct 14, 2021
1 parent 21c9f04 commit b9e0b02
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,6 @@ function gutenberg_initialize_experiments_settings() {
'id' => 'gutenberg-navigation',
)
);
add_settings_field(
'gutenberg-gallery-refactor',
__( 'Gallery block experiment', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test a new gallery block that uses nested image blocks (Warning: The new gallery is not compatible with WordPress mobile apps prior to version 18.2. If you use the mobile app, please update to the latest version to avoid content loss.)', 'gutenberg' ),
'id' => 'gutenberg-gallery-refactor',
)
);
register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down Expand Up @@ -108,9 +97,12 @@ function gutenberg_display_experiment_section() {
* @return array Filtered editor settings.
*/
function gutenberg_experiments_editor_settings( $settings ) {
$experiments = get_option( 'gutenberg-experiments' );
// The refactored gallery currently can't be run on sites with use_balanceTags option set.
// This bypass need to remain in place until this is is resolved and patch released.
// https://core.trac.wordpress.org/ticket/54130.
$balance_tags = get_option( 'use_balanceTags' );
$experiments_settings = array(
'__unstableGalleryWithImageBlocks' => isset( $experiments['gutenberg-gallery-refactor'] ),
'__unstableGalleryWithImageBlocks' => '1' !== $balance_tags,
);
return array_merge( $settings, $experiments_settings );
}
Expand Down

0 comments on commit b9e0b02

Please sign in to comment.