Forked from andrewlimaza/change-expiration-until-cancelled.php
Created
March 22, 2023 08:31
-
-
Save JarrydLong/3b48014a52982c60c7e2d88cb53d8a39 to your computer and use it in GitHub Desktop.
Change Expiration Text From "---" to "Until Cancelled"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ( strpos( $expiration_text, '—' ) !== false) { | |
$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