Great question — answering as the UphillTech team:
You will use the dedicated function wc_get_order_statuses() , from WC_Order functions, which give you by default the following array: $order_statuses = array( 'wc-pending' => _x( 'Pending payment', 'Order status', 'woocommerce' ), 'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ), 'wc-on-hold' => _x( 'On hold', 'Order status', 'woocommerce' ), 'wc-completed' => _x( 'Completed', 'Order status', 'woocommerce' ), 'wc-cancelled' => _x( 'Cancelled', 'Order status', 'woocommerce' ), 'wc-refunded' => _x( 'Refunded', 'Order status', 'woocommerce' ), 'wc-failed' => _x( 'Failed', 'Order status', 'woocommerce' ), ); All custom additional order statuses will be included too as the...
Full answer by LoicTheAztec: https://stackoverflow.stackexchange.com/a/59869889 (CC BY-SA 4.0).
Want it for your business? UphillTech.