Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Paid Memberships Pro Expiration Text to Show Date instead of Term. E.g. "Membership expires on 12/31/2013."
/*
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);
@amityweb

This comment has been minimized.

Copy link

amityweb commented Nov 20, 2016

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

@bryansayler

This comment has been minimized.

Copy link

bryansayler commented Apr 9, 2018

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
You can’t perform that action at this time.