Forked from MaryOJob/redirect_after_pmpro_checkout.php
Last active
October 27, 2023 12:15
-
-
Save kimwhite/cc1da3c8ab198cc67afb254c5ad6d9d7 to your computer and use it in GitHub Desktop.
Redirect to another page / site after a PMPro checkout.
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
| <?php // DO NOT COPY THIS LINE | |
| <?php // do not copy this line. | |
| /** | |
| * This recipe will redirect a new members after checkout for a specific level | |
| * See full article here: | |
| *. https://www.paidmembershipspro.com/set-up-unique-membership-confirmation-pages-based-on-level/ | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_confirmation_url($rurl, $user_id, $pmpro_level) { | |
| if(pmpro_hasMembershipLevel(1)) // change 1 to the id of your level | |
| $rurl = "/page-slug/"; | |
| return $rurl; | |
| } | |
| add_filter('pmpro_confirmation_url', 'my_pmpro_confirmation_url', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment