Created
April 13, 2014 04:35
-
-
Save webaware/10569363 to your computer and use it in GitHub Desktop.
only allow Monthly for recurring payments for Gravity Forms eWAY plugin
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 | |
/* | |
Plugin Name: GFeWAY Recurring Monthly | |
Plugin URI: https://gist.github.com/webaware/10569363 | |
Description: only allow Monthly for recurring payments | |
Version: 1 | |
Author: WebAware | |
Author URI: http://webaware.com.au/ | |
@ref: http://wordpress.org/support/topic/how-to-make-interval-type-have-monthly-option-only | |
*/ | |
/** | |
* filter the available recurring periods | |
* @param array $periods an array of billing periods ('weekly', 'fortnightly', 'monthly', 'yearly') | |
* @param int $form_id ID of form the field is on | |
* @return array | |
*/ | |
add_filter('gfeway_recurring_periods', function($periods, $form_id) { | |
$periods = array('monthly'); | |
return $periods; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment