WC_REST_Report_Sales_V1_Controller::get_collection_params
Get the query params for collections.
Method of the class: WC_REST_Report_Sales_V1_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Report_Sales_V1_Controller = new WC_REST_Report_Sales_V1_Controller(); $WC_REST_Report_Sales_V1_Controller->get_collection_params();
WC_REST_Report_Sales_V1_Controller::get_collection_params() WC REST Report Sales V1 Controller::get collection params code WC 10.3.6
public function get_collection_params() {
return array(
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
'period' => array(
'description' => __( 'Report period.', 'woocommerce' ),
'type' => 'string',
'enum' => array( 'week', 'month', 'last_month', 'year' ),
'validate_callback' => 'rest_validate_request_arg',
'sanitize_callback' => 'sanitize_text_field',
),
'date_min' => array(
/* translators: %s: date format */
'description' => sprintf( __( 'Return sales for a specific start date, the date need to be in the %s format.', 'woocommerce' ), 'YYYY-MM-DD' ),
'type' => 'string',
'format' => 'date',
'validate_callback' => 'wc_rest_validate_reports_request_arg',
'sanitize_callback' => 'sanitize_text_field',
),
'date_max' => array(
/* translators: %s: date format */
'description' => sprintf( __( 'Return sales for a specific end date, the date need to be in the %s format.', 'woocommerce' ), 'YYYY-MM-DD' ),
'type' => 'string',
'format' => 'date',
'validate_callback' => 'wc_rest_validate_reports_request_arg',
'sanitize_callback' => 'sanitize_text_field',
),
);
}