woocommerce_register_shop_order_post_statuses

Register our custom post statuses, used for order status.

Description

apply_filters( 'woocommerce_register_shop_order_post_statuses', (callback) $array ); 

Parameters (1)

0. $array — Optional. (callback) => array( 'wc-pending' => array( 'label' => _x( 'Pending payment', '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( 'Pending payment (%s)', 'Pending payment (%s)', 'woocommerce' ), ), 'wc-processing' => array( 'label' => _x( 'Processing', '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( 'Processing (%s)', 'Processing (%s)', 'woocommerce' ), ), 'wc-on-hold' => array( 'label' => _x( 'On hold', '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( 'On hold (%s)', 'On hold (%s)', 'woocommerce' ), ), 'wc-completed' => array( 'label' => _x( 'Completed', '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( 'Completed (%s)', 'Completed (%s)', 'woocommerce' ), ), 'wc-cancelled' => array( 'label' => _x( 'Cancelled', '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( 'Cancelled (%s)', 'Cancelled (%s)', 'woocommerce' ), ), 'wc-refunded' => array( 'label' => _x( 'Refunded', '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( 'Refunded (%s)', 'Refunded (%s)', 'woocommerce' ), ), 'wc-failed' => array( 'label' => _x( 'Failed', '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( 'Failed (%s)', 'Failed (%s)', 'woocommerce' ), ), )
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'woocommerce_register_shop_order_post_statuses', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_register_shop_order_post_statuses callback 
  2. function filter_woocommerce_register_shop_order_post_statuses( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_register_shop_order_post_statuses', 'filter_woocommerce_register_shop_order_post_statuses', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_register_shop_order_post_statuses', 'filter_woocommerce_register_shop_order_post_statuses', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-post-types.php  
  1. $order_statuses = apply_filters( 'woocommerce_register_shop_order_post_statuses',