WordPress filter hook

woocommerce_cod_process_payment_order_status

Defined by WooCommerce and fired by 7 plugins in total, running on 7M+ sites between them.

“Filter the order status for COD orders.”

How to use woocommerce_cod_process_payment_order_status

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_cod_process_payment_order_status', function( $value, $order ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from MStore API's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

7 plugins that fire woocommerce_cod_process_payment_order_status

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? OrderStatus::ON_HOLD : OrderStatus::PROCESSING, $order ) includes/gateways/cod/class-wc-gateway-cod.php:137
  2. MStore API icon MStore API2,000+ installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ) controllers/flutter-order.php:557
  3. Cargus icon Cargus800+ installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ) admin/class-cargus-ship-and-go-payment.php:157
  4. Yaxii Smart Form Lite icon Yaxii Smart Form Lite10+ installs apply_filters( 'woocommerce_cod_process_payment_order_status', $default, $order ) src/Order/OrderCreator.php:157
  5. Pay by Cash for Woocommerce icon Pay by Cash for Woocommerce10+ installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ) class-wc-gateway-pay-by-cash.php:298
  6. CrewCommerce icon CrewCommerceFewer than 10 installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ) includes/class-approvals.php:1130
  7. Wasl Cart icon Wasl CartFewer than 10 installs apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ) includes/class-wasl-buy-now.php:363

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.