Forked from thenbrent/extend-subscription-intervals.php
Last active
February 4, 2020 08:19
-
-
Save iMazed/08a6a26de32766c588f260532351cde0 to your computer and use it in GitHub Desktop.
Add a new billing interval to WooCommerce Subscriptions. Specifically a "every 25 weeks" billing interval to selling a subscription to something and be charged every 10 weeks.
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: Extend WooCommerce Subscription Intervals | |
* Description: Add a "every 25" billing interval to WooCommerce Subscriptions | |
* Author: Brent Shepherd | |
* Author URI: http://brent.io | |
* Version: 1.0 | |
* License: GPL v2 | |
*/ | |
function eg_extend_subscription_period_intervals( $intervals ) { | |
$intervals[25] = sprintf( __( 'every %s', 'my-text-domain' ), WC_Subscriptions::append_numeral_suffix( 25 ) ); | |
return $intervals; | |
} | |
add_filter( 'woocommerce_subscription_period_interval_strings', 'eg_extend_subscription_period_intervals' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment