WC_API_Orders::get_order_statuses()publicWC 2.1

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{}

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() code WC 8.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 ) );
}