Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created June 17, 2016 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/e922e79bc40eb0729095abc561cfe621 to your computer and use it in GitHub Desktop.
Save bekarice/e922e79bc40eb0729095abc561cfe621 to your computer and use it in GitHub Desktop.
Adds new order statuses to WooCommerce that require payment
<?php // only copy if needed
/**
* Add new statuses to order statuses that require payment
*
* @param array $statuses the array of statuses that require payment
* @param \WC_Order $order
* @return array - updated status array
*/
function sv_wc_order_statuses_needs_payment( $statuses, $order ) {
// use your custom order status slug here
$statuses[] = 'invoiced';
return $statuses;
}
add_filter( 'woocommerce_valid_order_statuses_for_payment', 'sv_wc_order_statuses_needs_payment', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment