wppaste
WordPress

render_block_core_search( array $attributes ): string

Since
6.3.0
Source
wp-includes/blocks/search.php:17
Dynamically renders the core/search block.

Compatibility

WordPress
since 6.3.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$attributesarray
The block attributes.

Return value

string
The search block markup.

Performance profile

How much work a call to render_block_core_search() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Trivial

Touches nothing outside its own arguments.

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
148–269

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 388.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • hookthird-party callbacksapply_filters()one call below render_block_core_search()

Further down the call graph this can also reach option, cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 28 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost render_block_core_search() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
$value && !->next_tag() && empty($typography_classes) && $button_position !== "button-only"148–156__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""155–161__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position === "button-only"167–175__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""174–180__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position !== "button-only"176–191__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""183–196__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only"183–197__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""190–202__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only"192–207__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && $button_position === "button-only"195–210__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""199–212__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only"199–213__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), home_url(), esc_url(), sprintf()
16 further outcomes, up to 269 instructions
$value && !->next_tag() && empty($typography_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""202–215__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && empty($color_classes) && $button_position === "button-only"202–216__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""206–218__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && !->next_tag() && empty($typography_classes) && empty($color_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""209–221__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only"211–226__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""218–231__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only"218–232__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only"224–239__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""225–237__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), wp_strip_all_tags(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""231–244__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only"231–245__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position !== "button-only" && $tag_name !== "search" && $tag_name === ""238–250__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only"243–258__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""250–263__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only"250–264__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), home_url(), esc_url(), sprintf()
$value && empty($typography_classes) && empty($color_classes) && $button_position === "button-only" && $tag_name !== "search" && $tag_name === ""257–269__(), __(), label(), wp_unique_id(), classnames_for_block_core_search(), styles_for_block_core_search(), get_color_classes_for_block_core_search(), get_typography_classes_for_block_core_search(), get_border_color_classes_for_block_core_search(), wp_kses_post(), sprintf(), wp_parse_args(), ->next_tag(), ->next_tag(), wp_kses_post(), wp_theme_get_element_class_name(), ->next_tag(), ->add_class(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), __(), ->set_attribute(), ->set_attribute(), ->set_attribute(), ->set_attribute(), esc_attr(), class(), __(), __(), isSearchInputVisible(), current_theme_supports(), home_url(), esc_url(), sprintf()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev386147–268362 fewer instructions than PHP 8.5
8.5388148–26936
8.4388148–2693610 fewer instructions than PHP 8.3
8.3398152–27636
8.2398152–27636
8.1398152–276362 fewer instructions than PHP 7.4
7.4400152–27636

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Uses · 20

Show all 20

Source code

function render_block_core_search( $attributes ) {	// Older versions of the Search block defaulted the label and buttonText	// attributes to `__( 'Search' )` meaning that many posts contain `<!--	// wp:search /-->`. Support these by defaulting an undefined label and	// buttonText to `__( 'Search' )`.	$attributes = wp_parse_args(		$attributes,		array(			'label'      => __( 'Search' ),			'buttonText' => __( 'Search' ),		)	); 	$input_id            = wp_unique_id( 'wp-block-search__input-' );	$classnames          = classnames_for_block_core_search( $attributes );	$show_label          = ! empty( $attributes['showLabel'] );	$use_icon_button     = ! empty( $attributes['buttonUseIcon'] );	$show_button         = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true;	$button_position     = $show_button ? $attributes['buttonPosition'] : null;	$query_params        = ( ! empty( $attributes['query'] ) ) ? $attributes['query'] : array();	$button              = '';	$query_params_markup = '';	$inline_styles       = styles_for_block_core_search( $attributes );	$color_classes       = get_color_classes_for_block_core_search( $attributes );	$typography_classes  = get_typography_classes_for_block_core_search( $attributes );	$is_button_inside    = ! empty( $attributes['buttonPosition'] ) &&		'button-inside' === $attributes['buttonPosition'];	// Border color classes need to be applied to the elements that have a border color.	$border_color_classes = get_border_color_classes_for_block_core_search( $attributes );	// This variable is a constant and its value is always false at this moment.	// It is defined this way because some values depend on it, in case it changes in the future.	$open_by_default = false; 	$label_inner_html = empty( $attributes['label'] ) ? __( 'Search' ) : wp_kses_post( $attributes['label'] );	$label            = new WP_HTML_Tag_Processor( sprintf( '<label %1$s>%2$s</label>', $inline_styles['label'], $label_inner_html ) );	if ( $label->next_tag() ) {		$label->set_attribute( 'for', $input_id );		$label->add_class( 'wp-block-search__label' );		if ( $show_label && ! empty( $attributes['label'] ) ) {			if ( ! empty( $typography_classes ) ) {				$label->add_class( $typography_classes );			}		} else {			$label->add_class( 'screen-reader-text' );		}	} 	$input         = new WP_HTML_Tag_Processor( sprintf( '<input type="search" name="s" required %s/>', $inline_styles['input'] ) );	$input_classes = array( 'wp-block-search__input' );	if ( ! $is_button_inside && ! empty( $border_color_classes ) ) {		$input_classes[] = $border_color_classes;	}	if ( ! empty( $typography_classes ) ) {		$input_classes[] = $typography_classes;	}	if ( ! $show_button && ! empty( $color_classes ) ) {		$input_classes[] = $color_classes;	}	if ( $input->next_tag() ) {		$input->add_class( implode( ' ', $input_classes ) );		$input->set_attribute( 'id', $input_id );		$input->set_attribute( 'value', get_search_query( false ) );		$input->set_attribute( 'placeholder', $attributes['placeholder'] ); 		// If it's interactive, enqueue the script module and add the directives.		$is_expandable_searchfield = 'button-only' === $button_position;		if ( $is_expandable_searchfield ) {			wp_enqueue_script_module( '@wordpress/block-library/search/view' ); 			$input->set_attribute( 'data-wp-bind--aria-hidden', '!context.isSearchInputVisible' );			$input->set_attribute( 'data-wp-bind--tabindex', 'state.tabindex' ); 			// Adding these attributes manually is needed until the Interactivity API			// SSR logic is added to core.			$input->set_attribute( 'aria-hidden', 'true' );			$input->set_attribute( 'tabindex', '-1' );		}	} 	if ( count( $query_params ) > 0 ) {

Changelog

Introduced in 6.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/blocks/search.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.