Skip to content

Instantly share code, notes, and snippets.

@zorem
Last active May 27, 2021 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zorem/abdd42a23fcdf6c69861e1e9d436de74 to your computer and use it in GitHub Desktop.
Save zorem/abdd42a23fcdf6c69861e1e9d436de74 to your computer and use it in GitHub Desktop.
Renaming WooCommerce Order Status
<?php
add_filter( 'wc_order_statuses', 'wc_renaming_order_status' );
/*
* Rename WooCommerce Order Status
*/
function wc_renaming_order_status( $order_statuses ) {
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-partial-shipped' === $key ) {
$order_statuses['wc-partial-shipped'] = esc_html__( 'Packed','text-domain' );
}
}
return $order_statuses;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment