Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shameemreza/ea573864e67722c70369415bd28b7aef to your computer and use it in GitHub Desktop.

Select an option

Save shameemreza/ea573864e67722c70369415bd28b7aef to your computer and use it in GitHub Desktop.
Change the price string globally for WooCommerce Subscriptions
add_filter( 'woocommerce_subscription_price_string', 'change_subscription_text', 10, 2 );
function change_subscription_text( $subscription_string, $subscription_details ) {
if ( $subscription_details['subscription_period'] === 'month' ) {
$subscription_string = str_replace( 'Monthly Subscription', '30 Day Subscription', $subscription_string );
}
return $subscription_string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment