Skip to content

Instantly share code, notes, and snippets.

@webaware
Created April 13, 2014 04:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webaware/10569363 to your computer and use it in GitHub Desktop.
Save webaware/10569363 to your computer and use it in GitHub Desktop.
only allow Monthly for recurring payments for Gravity Forms eWAY plugin
<?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