Forked from thenbrent/extend-subscription-lengths.php
Created
March 30, 2018 19:31
-
-
Save malikperang/2f13e6b5b5da2cb1c2cc4965516a915f to your computer and use it in GitHub Desktop.
Add a new billing range to WooCommerce Subscriptions to allow for longer subscription lengths. Specifically a new "36 months" range to allow you to sell a subscription with a length of 36 months.Requires Subscriptions 1.4.4 or newer.
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: WooCommerce Subscription Length Extender | |
* Description: Add a custom 36 month subscription length to WooCommerce Subscriptions (requires WC Subscriptions 1.4.4 or newer) to give the option of having a subscription expire after 36 months. | |
* Author: Brent Shepherd | |
* Version: 1.0 | |
* License: GPL v2 | |
*/ | |
function eg_extend_subscription_expiration_options( $subscription_lengths ) { | |
$subscription_lengths['month'][36] = wcs_get_subscription_period_strings( 36, 'month' ); | |
return $subscription_lengths; | |
} | |
add_filter( 'woocommerce_subscription_lengths', 'eg_extend_subscription_expiration_options' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment