Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('init', function () {
- register_post_status('wc-shipped', array(
- 'label' => __( 'Shipped', 'woocommerce' ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'show_in_admin_all_list' => true,
- 'show_in_admin_status_list' => true,
- 'label_count' => _n_noop('Shipped <span class="count">(%s)</span>', 'Shipped <span class="count">(%s)</span>')
- ));
- });
- add_filter('wc_order_statuses', function ($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-shipped'] = __('Shipped', 'woocommerce' );
- }
- }
- return $new_order_statuses;
- });
- add_filter('wcfm_is_allow_change_main_order_status_on_all_item_shipped', '__return_true');
- add_filter('wcfm_main_order_status_on_all_item_shipped', function($status) {
- return 'shipped';
- });
- add_action( 'before_wcfm_order_status_update', function() {
- global $WCFMmp;
- remove_action( 'before_wcfm_order_status_update', array( $WCFMmp->ajax, 'wcfmmp_vendor_order_status_update' ), 10 );
- }, 9);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement