WP_REST_Font_Families_Controller::get_collection_params(): array

In this article

Retrieves the query params for the font family collection.

Return

array Collection parameters.

Source

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 );
}

Hooks

apply_filters( ‘rest_wp_font_family_collection_params’, array $query_params )

Filters collection parameters for the font family controller.

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.