woocommerce_cod_process_payment_order_status
Filter the order status for COD orders.
Usage
add_filter( 'woocommerce_cod_process_payment_order_status', 'wp_kama_woocommerce_cod_process_payment_order_status_filter', 10, 2 );
/**
* Function for `woocommerce_cod_process_payment_order_status` filter-hook.
*
* @param string $order_status Default status for COD orders.
* @param $order
*
* @return string
*/
function wp_kama_woocommerce_cod_process_payment_order_status_filter( $order_status, $order ){
// filter...
return $order_status;
}
- $order_status(string)
- Default status for COD orders.
- $order
- -
Changelog
| Since 2.6.0 | Introduced. |
Where the hook is called
woocommerce_cod_process_payment_order_status
woocommerce/includes/gateways/cod/class-wc-gateway-cod.php 322
$process_payment_status = apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? OrderStatus::ON_HOLD : OrderStatus::PROCESSING, $order );