woocommerce_cancel_unpaid_order

woocommerce_cancel_unpaid_order

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_cancel_unpaid_order') is found 1 times:

  • /includes/wc-order-functions.php line 1046
    	if ( $unpaid_orders ) {
    		foreach ( $unpaid_orders as $unpaid_order ) {
    			$order = wc_get_order( $unpaid_order );
    
    			if ( apply_filters( 'woocommerce_cancel_unpaid_order', 'checkout' === $order->get_created_via(), $order ) ) {
    				$order->update_status( 'cancelled', __( 'Unpaid order cancelled - time limit reached.', 'woocommerce' ) );
    			}
    		}
    	}
    }
    add_action( 'woocommerce_cancel_unpaid_orders', 'wc_cancel_unpaid_orders' );