Forked from sc0ttkclark/my-pmpro-redirect-to-referring-page-after-checkout.md
Last active
December 12, 2024 07:03
-
-
Save ipokkel/32d6ba9425d4550a5861709498e00135 to your computer and use it in GitHub Desktop.
Redirect new members and existing members that changes their existing level back to the referring page after 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 | |
/** | |
* Updated with https://gist.github.com/ipokkel/fdfeb10a8120777661fbef4e8ed80fa0 | |
* This gist is kept for archival purposes, use the updated one above please. | |
*/ |
Thank you This works for posts but not for custom post types. I am using WP Job Manager and the listings redirect to a subscription page when visited by a non-member. How can I modify these codes to append the referrer to the job listings so that after checkout the user is redirected back to the previous page? Thank you for your help.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@GiannisRallis This is experimental code that is intended to redirect users back to the last page/post they visited before checking out for membership and is not designed to redirect users to a custom URL per level after checkout.
You should be able to achieve the latter by hooking into the
pmpro_confirmation_url
filter. Here is a gist that you or your developer may use as an example to tweak to suit your site-specific requirements - https://gist.github.com/ipokkel/c9fb4f9bece3814ffa5120c23a61b811I hope this helps get you started. :)