WC_API_Orders::get_order_statuses()
Get a list of valid order statuses
Note this requires no specific permissions other than being an authenticated API user. Order statuses (particularly custom statuses) could be considered private information which is why it's not in the API index.
Method of the class: WC_API_Orders{}
Hooks from the method
Return
Array
.
Usage
$WC_API_Orders = new WC_API_Orders(); $WC_API_Orders->get_order_statuses();
Changelog
Since 2.1 | Introduced. |
WC_API_Orders::get_order_statuses() WC API Orders::get order statuses code WC 7.7.0
public function get_order_statuses() { $order_statuses = array(); foreach ( wc_get_order_statuses() as $slug => $name ) { $order_statuses[ str_replace( 'wc-', '', $slug ) ] = $name; } return array( 'order_statuses' => apply_filters( 'woocommerce_api_order_statuses_response', $order_statuses, $this ) ); }