Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Last active November 29, 2018 17:18
Show Gist options
  • Save jrick1229/def3e5700182c44d01eaf6a7f95cb751 to your computer and use it in GitHub Desktop.
Save jrick1229/def3e5700182c44d01eaf6a7f95cb751 to your computer and use it in GitHub Desktop.
Extend the expiration options for subscriptions
<?php
function eg_extend_subscription_expiration_options( $subscription_lengths ) {
$subscription_lengths['year'][10] = wcs_get_subscription_period_strings( 10, 'year' );
$subscription_lengths['year'][20] = wcs_get_subscription_period_strings( 20, 'year' );
$subscription_lengths['month'][48] = wcs_get_subscription_period_strings( 48, '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