WC_API_Orders::get_order_statuses()

Get a list of valid order statuses


Description Description

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.


Return Return

(array)


Top ↑

Source Source

File: includes/legacy/api/v2/class-wc-api-orders.php

	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 ) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.