Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Jan 6, 2025
1 parent dd42f50 commit 1d70719
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ function render_block_core_search( $attributes, $content, $block ) {
// Check if the block is using the enhanced pagination.
$enhanced_pagination = isset( $block->context['enhancedPagination'] ) && $block->context['enhancedPagination'];

// Check if the block is using the instant search experiment.
// Check if the block is using the instant search experiment, which requires the enhanced pagination.
$gutenberg_experiments = get_option( 'gutenberg-experiments' );
$instant_search_enabled = $enhanced_pagination && $gutenberg_experiments && array_key_exists( 'gutenberg-search-query-block', $gutenberg_experiments );

$show_button = true;

// If the block is using the instant search experiment and the enhanced pagination, hide the button.
if ( $instant_search_enabled ) {
$show_button = false;
// If the button position is no-button, ALSO hide the button.
Expand Down

0 comments on commit 1d70719

Please sign in to comment.