Created
June 17, 2016 14:29
-
-
Save bekarice/e922e79bc40eb0729095abc561cfe621 to your computer and use it in GitHub Desktop.
Adds new order statuses to WooCommerce that require payment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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