WP_REST_Block_Directory_Controller::get_collection_params()
Retrieves the search params for the blocks collection.
Метод класса: WP_REST_Block_Directory_Controller{}
Хуки из метода
Возвращает
Массив
. Collection parameters.
Использование
$WP_REST_Block_Directory_Controller = new WP_REST_Block_Directory_Controller(); $WP_REST_Block_Directory_Controller->get_collection_params();
Список изменений
С версии 5.5.0 | Введена. |
Код WP_REST_Block_Directory_Controller::get_collection_params() WP REST Block Directory Controller::get collection params WP 6.2.2
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'] ); /** * Filters REST API 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 ); }