WP_REST_Font_Families_Controller::get_collection_params
Retrieves the query params for the font family collection.
Method of the class: WP_REST_Font_Families_Controller{}
Hooks from the method
Returns
Array. Collection parameters.
Usage
$WP_REST_Font_Families_Controller = new WP_REST_Font_Families_Controller(); $WP_REST_Font_Families_Controller->get_collection_params();
Changelog
| Since 6.5.0 | Introduced. |
WP_REST_Font_Families_Controller::get_collection_params() WP REST Font Families Controller::get collection params code WP 7.0
public function get_collection_params() {
$query_params = parent::get_collection_params();
// Remove unneeded params.
unset(
$query_params['after'],
$query_params['modified_after'],
$query_params['before'],
$query_params['modified_before'],
$query_params['search'],
$query_params['search_columns'],
$query_params['status']
);
$query_params['orderby']['default'] = 'id';
$query_params['orderby']['enum'] = array( 'id', 'include' );
/**
* Filters collection parameters for the font family controller.
*
* @since 6.5.0
*
* @param array $query_params JSON Schema-formatted collection parameters.
*/
return apply_filters( 'rest_wp_font_family_collection_params', $query_params );
}