woocommerce_default_order_status

woocommerce_default_order_status

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_default_order_status') is found 2 times:

  • /includes/abstracts/abstract-wc-order.php line 403
    		$status = $this->get_prop( 'status', $context );
    
    		if ( empty( $status ) && 'view' === $context ) {
    			// In view context, return the default status if no status has been set.
    			$status = apply_filters( 'woocommerce_default_order_status', 'pending' );
    		}
    		return $status;
    	}
    
    	/**
    	 * Get discount_total.
    
  • /includes/data-stores/abstract-wc-order-data-store-cpt.php line 348
    	protected function get_post_status( $order ) {
    		$order_status = $order->get_status( 'edit' );
    
    		if ( ! $order_status ) {
    			$order_status = apply_filters( 'woocommerce_default_order_status', 'pending' );
    		}
    
    		$post_status    = $order_status;
    		$valid_statuses = get_post_stati();
    
    		// Add a wc- prefix to the status, but exclude some core statuses which should not be prefixed.
    

See this hook used in plugins: