Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Last active March 1, 2023 21:54
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 jrick1229/02fb7f7bcc1e9e6911c4b74fea08a518 to your computer and use it in GitHub Desktop.
Save jrick1229/02fb7f7bcc1e9e6911c4b74fea08a518 to your computer and use it in GitHub Desktop.
Add an extra billing interval to WooCommerce Subscriptions
<?php
function wcs_custom_frequency( $intervals ) {
// change the $custom_frequency variable numerical value to what you'd like to add.
$custom_frequency = 50;
$intervals[$custom_frequency] = sprintf( __( 'every %s', 'my-text-domain' ), WC_Subscriptions::append_numeral_suffix( $custom_frequency ) );
return $intervals;
}
add_filter( 'woocommerce_subscription_period_interval_strings', 'wcs_custom_frequency' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment