Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Redirect the Paid Memberships Pro confirmation to a page for a specific upsell unless the user already has that level.
<?php
/*
Redirect to a URL promoting an upsell unless the user already has that level.
Add this code into a custom plugin.
*/
function pmpro_confirmation_url_to_upsell($rurl, $user_id, $pmpro_level) {
$upsell_level_id = 2; //change this
$upsell_url = 'https://example.com/upsell-page/'; //change this
if(!pmpro_hasMembershipLevel($upsell_level_id, $user_id))
$rurl = $upsell_url;
return $rurl;
}
add_filter('pmpro_confirmation_url', 'pmpro_confirmation_url_to_upsell', 10, 3);
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.