Skip to content

Instantly share code, notes, and snippets.

@PechenkiUA
Created March 28, 2023 16:22
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 PechenkiUA/1c6d53b652c530e6a5db935b7a29a471 to your computer and use it in GitHub Desktop.
Save PechenkiUA/1c6d53b652c530e6a5db935b7a29a471 to your computer and use it in GitHub Desktop.
Telsender WC status name
<?php
/**
* Telsender WC status name
* @param $list
* @param $order_id
* @return mixed
*/
function telsender_status_translate($list, $order_id){
$order = wc_get_order( $order_id );
$status = $order->get_status();
$status_name = wc_get_order_status_name( $status );
$list['{status_translate}'] = $status_name;
return $list;
}
add_filter('tscf_filter_codetemplate', 'telsender_status_translate', 20, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment