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.

Метод класса: WC_API_Orders{}

Хуки из метода

Возвращает

Массив.

Использование

$WC_API_Orders = new WC_API_Orders();
$WC_API_Orders->get_order_statuses();

Список изменений

С версии 2.1 Введена.

Код WC_API_Orders::get_order_statuses() 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 ) );
}