Created
November 6, 2017 09:50
-
-
Save ideadude/c09ca54c943dea7e91a30a4ef6ff7179 to your computer and use it in GitHub Desktop.
Update prices on the pricing page for current members with Paid Memberships Pro.
This file contains hidden or 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
/* | |
Update Prices on the Pricing page for current members. | |
Add this code to a custom plugin. | |
*/ | |
function pmpro_level_cost_text_filter_pricing_page($cost, $level, $tags, $short) { | |
//if we're not on the pricing page, just return | |
global $pmpro_pages; | |
if(!is_page($pmpro_pages['levels'])) | |
return $cost; | |
//disable this filter so we don't get caught in a loop | |
remove_filter('pmpro_level_cost_text', 'pmpro_level_cost_text_filter_pricing_page', 10, 4); | |
//grab the level and run it through the checkout filter | |
$level = apply_filters('pmpro_checkout_level', $level); | |
$cost = pmpro_getLevelCost($level, $tags, $short); | |
//reenable this filter | |
add_filter('pmpro_level_cost_text', 'pmpro_level_cost_text_filter_pricing_page', 10, 4); | |
return $cost; | |
} | |
add_filter('pmpro_level_cost_text', 'pmpro_level_cost_text_filter_pricing_page', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment