Skip to content

Instantly share code, notes, and snippets.

@scottsousa
Created January 10, 2014 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottsousa/8357002 to your computer and use it in GitHub Desktop.
Save scottsousa/8357002 to your computer and use it in GitHub Desktop.
PMPro - Nicer level costs for trial periods
/*
Nicer level costs for levels that have trial periods.
*/
function nicer_pmpro_level_cost_text($text, $level)
{
global $pmpro_currency_symbol;
if(pmpro_isLevelFree($level))
$text = "Membership is free.";
// Levels that have a trial
elseif($level->trial_limit > 0)
$text = "After your initial payment of " . $pmpro_currency_symbol . $level->initial_payment . " your first " . $level->trial_limit . " " . $level->cycle_period . "s are free. Then you pay " . $pmpro_currency_symbol . $level->billing_amount . " per month.";
elseif($level->initial_payment == $level->billing_amount)
$text = $pmpro_currency_symbol . $level->initial_payment . "/" . $level->cycle_period;
return $text;
}
add_filter("pmpro_level_cost_text", "nicer_pmpro_level_cost_text", 15, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment