gravityflowwoocommerce_valid_payment_statuses
The gravityflowwoocommerce_valid_payment_statuses filter allows you to customize what statuses are valid for the capture payment step beyond the default of 'on-hold'.
See WooCommerce Capture Payment Step for more details.
Parameters
Parameter | Type | Definition |
---|---|---|
$statuses | Array | The statuses you would like to capture the payment from. |
$step | Gravity_Flow_Step | The current step. |
Examples
Example 1 - Add pending status
add_filter( 'gravityflowwoocommerce_valid_payment_statuses', 'my_gravityflowwoocommerce_valid_payment_statuses', 10, 2 ); function my_gravityflowwoocommerce_valid_payment_statuses( $statuses, $step ) { //Ensure you are only adjusting the desired form/step if ( $step->get_id() !== 76 ) { return $statuses; } <br> if ( $step === 'woocommerce_capture_payment' ) { $statuses[] = 'pending'; // Add the new status you'd like to capture the payment from. } return $statuses; }
Placement
This code should be placed in the functions.php file of your active theme or in a custom functions plugin.