I would like to get all slugs and names of all the WooCommerce order statuses.
I tried the answers from the following thread: Woocommerce get list of order statuses list but with no success.
I use latest woocommerce version. Any help is appreciated.
3
Answers
Add below snippet to functions.php and call woocommerce_get_order_statuses() where you want to use.
You will use the dedicated function
wc_get_order_statuses()
, from WC_Order functions, which give you by default the following array:wc_get_order_statuses() will provide only default WooCommerce statuses but to get all order statuses you may use the following function woocommerce_get_all_order_statuses()