Created
August 21, 2013 11:01
-
-
Save hlashbrooke/6293080 to your computer and use it in GitHub Desktop.
WooCommerce: Get all order statuses as an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function woocommerce_get_order_statuses() { | |
$order_statuses = get_terms( 'shop_order_status', array( 'hide_empty' => false ) ); | |
$statuses = array(); | |
foreach ( $order_statuses as $status ) { | |
$statuses[ $status->slug ] = $status->name; | |
} | |
return $statuses; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this code is outdated for WC > 3