'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'validate_callback' => 'rest_validate_request_arg',
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'validate_callback' => 'rest_validate_request_arg',
$params['persisted_query'] = array(
'description' => __( 'URL query to persist across links.', 'woocommerce' ),
'validate_callback' => 'rest_validate_request_arg',
* Get the schema, conforming to JSON Schema.
public function get_item_schema() {
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'leaderboard',
'description' => __( 'Leaderboard ID.', 'woocommerce' ),
'context' => array( 'view' ),
'description' => __( 'Displayed title for the leaderboard.', 'woocommerce' ),
'context' => array( 'view' ),
'description' => __( 'Table headers.', 'woocommerce' ),
'context' => array( 'view' ),
'description' => __( 'Table column header.', 'woocommerce' ),
'context' => array( 'view', 'edit' ),
'description' => __( 'Table rows.', 'woocommerce' ),
'context' => array( 'view' ),
'description' => __( 'Table cell display.', 'woocommerce' ),
'context' => array( 'view', 'edit' ),
'description' => __( 'Table cell value.', 'woocommerce' ),
'context' => array( 'view', 'edit' ),
'description' => __( 'Table cell format.', 'woocommerce' ),
'context' => array( 'view' ),
'enum' => array( 'currency', 'number' ),
return $this->add_additional_fields_schema( $schema );
* Get schema for the list of allowed leaderboards.
public function get_public_allowed_item_schema() {
$schema = $this->get_public_item_schema();
unset( $schema['properties']['rows'] );