WC_REST_Report_Sales_V1_Controller::get_collection_params() public WC 1.0
Get the query params for collections.
{} It's a method of the class: WC_REST_Report_Sales_V1_Controller{}
No Hooks.
Return
Array.
Usage
$WC_REST_Report_Sales_V1_Controller = new WC_REST_Report_Sales_V1_Controller(); $WC_REST_Report_Sales_V1_Controller->get_collection_params();
Code of WC_REST_Report_Sales_V1_Controller::get_collection_params() WC REST Report Sales V1 Controller::get collection params WC 5.0.0
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',
),
);
}