Forked from andrewlimaza/change-expiration-until-cancelled.php
Last active
January 27, 2023 00:58
-
-
Save michaelbeil/7a08754feafd240202853823dea1dca5 to your computer and use it in GitHub Desktop.
Change Expiration Text From "Never" to "Until Cancelled"
This file contains 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 ( $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