Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created August 21, 2013 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlashbrooke/6293080 to your computer and use it in GitHub Desktop.
Save hlashbrooke/6293080 to your computer and use it in GitHub Desktop.
WooCommerce: Get all order statuses as an array
<?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;
}
?>
@kappuccino
Copy link

this code is outdated for WC > 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment