Skip to content

Commit

Permalink
PHP formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Dec 18, 2024
1 parent fdfcf8e commit 8f32103
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ function render_block_core_search( $attributes, $content, $block ) {
$form_directives .= ' data-wp-on--submit="actions.handleSearchSubmit"';

// Get the canonical URL without pagination
$canonical_url_no_pagination = get_pagenum_link(1);
$canonical_url_no_pagination = get_pagenum_link( 1 );

// If we're on a singular post/page, use its permalink instead
if (is_singular()) {
if ( is_singular() ) {
$canonical_url_no_pagination = get_permalink();
}

wp_interactivity_config( 'core/search', array( 'canonicalURL' => $canonical_url_no_pagination ) );

$query_id = $block->context['queryId'];
$search = '';
$search = '';

// If the query is defined in the block context, use it
if ( isset( $block->context['query']['search'] ) && '' !== $block->context['query']['search'] ) {
Expand Down

0 comments on commit 8f32103

Please sign in to comment.