Last active
January 2, 2020 05:34
-
-
Save Musilda/6af4b93fa80fe4c20966b8976a1b51b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
add_filter( 'woocommerce_register_shop_order_post_statuses', 'musilda_register_custom_order_status' ); | |
function musilda_register_custom_order_status( $order_statuses ){ | |
$order_statuses['wc-custom-status'] = array( | |
'label' => _x( 'Custom Status', 'Order status', 'woocommerce' ), | |
'public' => false, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, | |
'show_in_admin_status_list' => true, | |
'label_count' => _n_noop( 'Custom Status <span class="count">(%s)</span>', 'Custom Status <span class="count">(%s)</span>', 'woocommerce' ), | |
); | |
return $order_statuses; | |
} | |
add_filter( 'wc_order_statuses', 'musilda_show_custom_order_status' ); | |
function musilda_show_custom_order_status( $order_statuses ) { | |
$order_statuses['wc-custom-status'] = _x( 'Custom Status', 'Order status', 'woocommerce' ); | |
return $order_statuses; | |
} | |
add_filter( 'bulk_actions-edit-shop_order', 'musilda_custom_order_status_bulk' ); | |
function musilda_custom_order_status_bulk( $bulk_actions ) { | |
$bulk_actions['mark_custom-status'] = 'Change status to custom status'; | |
return $bulk_actions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment