Created
January 10, 2014 16:00
-
-
Save scottsousa/8357002 to your computer and use it in GitHub Desktop.
PMPro - Nicer level costs for trial periods
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
/* | |
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