WordPress filter hook

woocommerce_valid_order_statuses_for_payment

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

“Filter the valid order statuses for payment.”

How to use woocommerce_valid_order_statuses_for_payment

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_valid_order_statuses_for_payment', function( $value, $order ) {
	// Change $value here.
	return $value;
}, 10, 2 );

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

15 plugins that fire woocommerce_valid_order_statuses_for_payment

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_valid_order_statuses_for_payment', array( OrderStatus::PENDING, OrderStatus::FAILED ), $this ) includes/class-wc-order.php:489
  2. WooPayments: Integrated WooCommerce Payments icon WooPayments: Integrated WooCommerce Payments800,000+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', [ Order_Status::PENDING, Order_Status::FAILED ], $order ) includes/class-duplicate-payment-prevention-service.php:253
  3. Dokan: AI Powered WooCommerce Multivendor Marketplace Solution icon Dokan: AI Powered WooCommerce Multivendor Marketplace Solution30,000+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', [ 'pending', 'failed' ], $order ) templates/my-orders.php:85
  4. Payoneer Checkout icon Payoneer Checkout5,000+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( OrderStatus::PENDING, OrderStatus::FAILED ), $order ) includes/Plugin.php:1371
  5. Youzify icon Youzify4,000+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) includes/public/templates/members/single/woocommerce/myaccount/related-orders.php:56
  6. 워드프레스 결제 심플페이 icon 워드프레스 결제 심플페이900+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'on-hold', 'pending', 'failed' ), $order ) includes/class-pafw-payment-gateway.php:435
  7. Sublium Subscriptions icon Sublium Subscriptions700+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'on-hold', 'failed', ), $order ) includes/main/subscriptions.php:315
  8. Subscriptions & Recurring Payments for WooCommerce icon Subscriptions & Recurring Payments for WooCommerce10+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'on-hold', 'failed' ), $order ) inc/aco-gateway/paypal/includes/class-awc-paypal-standard-switcher.php:247
  9. SkyHS icon SkyHS10+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'on-hold', 'failed' ), $order ) includes/early-renewal/class-skyhshoso-cart-early-renewal.php:481
  10. iw profile icon iw profile10+ installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) template/logged-in/orders.php:51
  11. YOUSEEME icon YOUSEEMEFewer than 10 installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array('pending', 'failed'), $order ) includes/class-ysme-gateway-card.php:282
  12. AVAR ProductPulse icon AVAR ProductPulseFewer than 10 installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', self::PAYABLE_FALLBACK, new \WC_Order() ) includes/Support/Order_Status_Policy.php:161
  13. CereTax Native icon CereTax NativeFewer than 10 installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) inc/class-cwafc.php:1384
  14. PayLolly Payment Gateway AddOn icon PayLolly Payment Gateway AddOnFewer than 10 installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) includes/class-wc-paylolly-gateway.php:687
  15. Munjr Subscriptions with Recurly for WooCommerce icon Munjr Subscriptions with Recurly for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) includes/class-ri-recurly-checkout-eligibility.php:350

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.