I have added custom order status in WooCommerce with the code below, and it's working. How can add this order status in WooCommerce bulk action drop-down on the order list page. I want to change the order status bulk.
// Register new order status
function register_on_production_order_status() {
register_post_status( 'wc-on-production', array(
'label' => 'On Production',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'On Production (%s)', 'On Production (%s)' )
) );
}
add_action( 'init', 'register_on_production_order_status' );
// Add to list of WC Order statuses in single order page
function add_on_production_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
// add new order status after processing
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-processing' === $key ) {
$new_order_statuses['wc-on-production'] = 'On Production';
}
}
return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_on_production_to_order_statuses' );