WP_REST_Font_Faces_Controller::get_collection_params()publicWP 6.5.0

Retrieves the query params for the font face collection.

Method of the class: WP_REST_Font_Faces_Controller{}

Hooks from the method

Return

Array. Collection parameters.

Usage

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

Changelog

Since 6.5.0 Introduced.

WP_REST_Font_Faces_Controller::get_collection_params() code WP 6.6.2

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['slug'],
		$query_params['status']
	);

	$query_params['orderby']['default'] = 'id';
	$query_params['orderby']['enum']    = array( 'id', 'include' );

	/**
	 * Filters collection parameters for the font face controller.
	 *
	 * @since 6.5.0
	 *
	 * @param array $query_params JSON Schema-formatted collection parameters.
	 */
	return apply_filters( 'rest_wp_font_face_collection_params', $query_params );
}