WordPress at a glance
function is not described

WP_REST_Block_Directory_Controller::get_collection_params() public WP 5.5.0

Retrieves the search params for the blocks collection.

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

Return

Array. Collection parameters.

Usage

$WP_REST_Block_Directory_Controller = new WP_REST_Block_Directory_Controller();
$WP_REST_Block_Directory_Controller->get_collection_params();

Changelog

Since 5.5.0 Introduced.

Code of WP_REST_Block_Directory_Controller::get_collection_params() WP 5.5.1

<?php
public function get_collection_params() {
	$query_params = parent::get_collection_params();

	$query_params['context']['default'] = 'view';

	$query_params['term'] = array(
		'description' => __( 'Limit result set to blocks matching the search term.' ),
		'type'        => 'string',
		'required'    => true,
		'minLength'   => 1,
	);

	unset( $query_params['search'] );

	/**
	 * Filter collection parameters for the block directory controller.
	 *
	 * @since 5.5.0
	 *
	 * @param array $query_params JSON Schema-formatted collection parameters.
	 */
	return apply_filters( 'rest_block_directory_collection_params', $query_params );
}