Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelbeil/7a08754feafd240202853823dea1dca5 to your computer and use it in GitHub Desktop.
Save michaelbeil/7a08754feafd240202853823dea1dca5 to your computer and use it in GitHub Desktop.
Change Expiration Text From "Never" to "Until Cancelled"
<?php
/**
* Change the account page expiration text to "Until Cancelled"
* for never expiring levels/members.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_adjust_expiration_text( $expiration_text, $level ) {
if ( $expiration_text === 'Never' ) {
$expiration_text = __( 'Until Cancelled', 'paid-memberships-pro' );
}
return $expiration_text;
}
add_filter( 'pmpro_account_membership_expiration_text', 'my_adjust_expiration_text', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment