Created
December 13, 2013 02:43
-
-
Save strangerstudios/7939124 to your computer and use it in GitHub Desktop.
Change Paid Memberships Pro Expiration Text to Show Date instead of Term. E.g. "Membership expires on 12/31/2013."
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
/* | |
Change Expiration Text to Show Date instead of Term | |
*/ | |
function my_pmpro_level_expiration_text($text, $level) | |
{ | |
if($level->expiration_number) | |
{ | |
$expiration_text = sprintf(_x("Membership expires on %s.", "Expiration text. E.g. Membership expires on 12/31/2013.", "pmpro"), date(get_option("date_format"), strtotime("+ " . $level->expiration_number . " " . $level->expiration_period))); | |
} | |
else | |
$expiration_text = ""; | |
return $expiration_text; | |
} | |
add_filter("pmpro_level_expiration_text", "my_pmpro_level_expiration_text", 5, 2); |
Can you use something similar to output the Renewal Date?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a typo in the above, its:
add_filter("pmpro_levels_expiration_text", "my_pmpro_level_expiration_text", 5, 2);
plural on pmpro_levels_expiration_text