Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Expiration Text From "---" 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 === '---' ) {
$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