

function register_already_shipped_order_status() {
register_post_status( 'wc-weighing', array(
'label' => '正在称重',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Weighing <span class="count">(%s)</span>', '正在称重 <span class="count">(%s)</span>' )
) );
}
function add_already_shipped_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-processing' === $key ) {
$new_order_statuses['wc-weighing'] = '正在称重';
}
}
return $new_order_statuses;
}
add_action( 'init', 'register_already_shipped_order_status' );
add_filter( 'wc_order_statuses', 'add_already_shipped_to_order_statuses' );