Created
April 22, 2020 19:41
-
-
Save growdev/cc45552811345ef6ea984662c3a5ed49 to your computer and use it in GitHub Desktop.
Toolbox for WC Subscriptions: Add this to theme functions file to allow manual renewal payment gateways to skip and set date.
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 | |
/** | |
* Remove the check for if a payment gateway supports "Date change" | |
*/ | |
remove_filter( 'wcs_view_subscription_actions', 'Javorszky\\Toolbox\\remove_actions', 20 ); | |
/** | |
* Allow date changes on subscriptions that are manual | |
* @param $subscription | |
* @return string | |
*/ | |
function sp_allow_manual_date_change( $subscription ) { | |
return 'yes'; | |
} | |
add_filter('jgtb_allow_edit_date_for_subscription', 'sp_allow_manual_date_change', 50 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment