-
-
Save ilumin/d7a6010277231a616b22 to your computer and use it in GitHub Desktop.
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 | |
// My new order statuses. | |
function register_my_new_order_statuses() { | |
register_post_status( 'wc-status-name', array( | |
'label' => _x( 'Status Name', 'Order status', 'textdomain' ), | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, | |
'show_in_admin_status_list' => true, | |
'label_count' => _n_noop( 'Status name <span class="count">(%s)</span>', 'Status names <span class="count">(%s)</span>', 'textdomain' ) | |
) ); | |
} | |
add_action( 'init', 'register_my_new_order_statuses' ); | |
// Register in wc_order_statuses. | |
function my_new_wc_order_statuses( $order_statuses ) { | |
$order_statuses['wc-status-name'] = _x( 'Status Name', 'Order status', 'textdomain' ); | |
return $order_statuses; | |
} | |
add_filter( 'wc_order_statuses', 'my_new_wc_order_statuses' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment