WordPress at a glance
function is not described

WP_REST_Search_Controller::__construct() public WP 5.0.0

Constructor.

{} It's a method of the class: WP_REST_Search_Controller{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_REST_Search_Controller = new WP_REST_Search_Controller();
$WP_REST_Search_Controller->__construct( $search_handlers );
$search_handlers(array) (required)
List of search handlers to use in the controller. Each search handler instance must extend the WP_REST_Search_Handler class.

Changelog

Since 5.0.0 Introduced.

Code of WP_REST_Search_Controller::__construct() WP 5.5.1

<?php
public function __construct( array $search_handlers ) {
	$this->namespace = 'wp/v2';
	$this->rest_base = 'search';

	foreach ( $search_handlers as $search_handler ) {
		if ( ! $search_handler instanceof WP_REST_Search_Handler ) {
			_doing_it_wrong(
				__METHOD__,
				/* translators: %s: PHP class name. */
				sprintf( __( 'REST search handlers must extend the %s class.' ), 'WP_REST_Search_Handler' ),
				'5.0.0'
			);
			continue;
		}

		$this->search_handlers[ $search_handler->get_type() ] = $search_handler;
	}
}