Added get_order_statuses to REST controllers where it's required.
This commit is contained in:
parent
c1af1da752
commit
f9a46423e0
|
@ -299,4 +299,19 @@ class WC_Admin_REST_Reports_Categories_Controller extends WC_REST_Reports_Contro
|
|||
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order statuses without prefixes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_order_statuses() {
|
||||
$order_statuses = array();
|
||||
|
||||
foreach ( array_keys( wc_get_order_statuses() ) as $status ) {
|
||||
$order_statuses[] = str_replace( 'wc-', '', $status );
|
||||
}
|
||||
|
||||
return $order_statuses;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -383,4 +383,19 @@ class WC_Admin_REST_Reports_Orders_Stats_Controller extends WC_REST_Reports_Cont
|
|||
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order statuses without prefixes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_order_statuses() {
|
||||
$order_statuses = array();
|
||||
|
||||
foreach ( array_keys( wc_get_order_statuses() ) as $status ) {
|
||||
$order_statuses[] = str_replace( 'wc-', '', $status );
|
||||
}
|
||||
|
||||
return $order_statuses;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -292,4 +292,19 @@ class WC_Admin_REST_Reports_Products_Controller extends WC_REST_Reports_Controll
|
|||
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order statuses without prefixes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_order_statuses() {
|
||||
$order_statuses = array();
|
||||
|
||||
foreach ( array_keys( wc_get_order_statuses() ) as $status ) {
|
||||
$order_statuses[] = str_replace( 'wc-', '', $status );
|
||||
}
|
||||
|
||||
return $order_statuses;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue