woocommerce_default_order_status

The WooCommerce woocommerce default order status hook.

Description

apply_filters( 'woocommerce_default_order_status', (string) $pending ); 

Parameters (1)

0. $pending (string) => 'pending'
The pending.

Usage

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

Defined (3)

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

/includes/data-stores/abstract-wc-order-data-store-cpt.php  
  1. 'post_status' => 'wc-' . ( $order->get_status( 'edit' ) ? $order->get_status( 'edit' ) : apply_filters( 'woocommerce_default_order_status', 'pending' ) ), 
  1. 'post_status' => 'wc-' . ( $order->get_status( 'edit' ) ? $order->get_status( 'edit' ) : apply_filters( 'woocommerce_default_order_status', 'pending' ) ), 
/includes/abstracts/abstract-wc-order.php  
  1. $status = apply_filters( 'woocommerce_default_order_status', 'pending' );