WP_REST_Abilities_V1_List_Controller::get_collection_paramspublicWP 6.9.0

Retrieves the query params for collections.

Метод класса: WP_REST_Abilities_V1_List_Controller{}

Хуков нет.

Возвращает

Массив<Строку,. mixed> Collection parameters.

Использование

$WP_REST_Abilities_V1_List_Controller = new WP_REST_Abilities_V1_List_Controller();
$WP_REST_Abilities_V1_List_Controller->get_collection_params(): array;

Список изменений

С версии 6.9.0 Введена.

Код WP_REST_Abilities_V1_List_Controller::get_collection_params() WP 6.9

public function get_collection_params(): array {
	return array(
		'context'  => $this->get_context_param( array( 'default' => 'view' ) ),
		'page'     => array(
			'description' => __( 'Current page of the collection.' ),
			'type'        => 'integer',
			'default'     => 1,
			'minimum'     => 1,
		),
		'per_page' => array(
			'description' => __( 'Maximum number of items to be returned in result set.' ),
			'type'        => 'integer',
			'default'     => 50,
			'minimum'     => 1,
			'maximum'     => 100,
		),
		'category' => array(
			'description'       => __( 'Limit results to abilities in specific ability category.' ),
			'type'              => 'string',
			'sanitize_callback' => 'sanitize_key',
			'validate_callback' => 'rest_validate_request_arg',
		),
	);
}