WP_REST_Post_Search_Handler::__construct()publicWP 5.0.0

Constructor.

Method of the class: WP_REST_Post_Search_Handler{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_REST_Post_Search_Handler = new WP_REST_Post_Search_Handler();
$WP_REST_Post_Search_Handler->__construct();

Changelog

Since 5.0.0 Introduced.

WP_REST_Post_Search_Handler::__construct() code WP 6.5.2

public function __construct() {
	$this->type = 'post';

	// Support all public post types except attachments.
	$this->subtypes = array_diff(
		array_values(
			get_post_types(
				array(
					'public'       => true,
					'show_in_rest' => true,
				),
				'names'
			)
		),
		array( 'attachment' )
	);
}