Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created December 13, 2013 02:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save strangerstudios/7939124 to your computer and use it in GitHub Desktop.
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."
/*
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
Copy link

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
Copy link

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