WP_REST_Icons_Controller::get_collection_params
Retrieves the query params for the icons collection.
Method of the class: WP_REST_Icons_Controller{}
No Hooks.
Returns
array. Collection parameters.
Usage
$WP_REST_Icons_Controller = new WP_REST_Icons_Controller(); $WP_REST_Icons_Controller->get_collection_params();
Changelog
| Since 7.0.0 | Introduced. |
| Since 7.1.0 | Added the collection parameter. |
WP_REST_Icons_Controller::get_collection_params() WP REST Icons Controller::get collection params code WP 7.1.5
public function get_collection_params() {
$query_params = parent::get_collection_params();
$query_params['context']['default'] = 'view';
$query_params['collection'] = array(
'description' => __( 'Limit results to icons belonging to the given collection slug.' ),
'type' => 'string',
'pattern' => '^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$',
);
return $query_params;
}