Created
February 23, 2018 13:00
-
-
Save ideadude/58bc71fb5b811a39592279b6e5687872 to your computer and use it in GitHub Desktop.
Redirect MEPR IPN URL to the PMPro IPN URL
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
/* | |
Redirect MEPR IPN URL to the PMPro IPN URL, e.g. | |
https://yoursite.com/mepr/notify/onibvz-5w6/ipn => | |
https://yoursite.com/wp-admin/admin-ajax.php?action=ipnhandler | |
Update line 9 to match the IPN URL given to you by MEPR | |
*/ | |
function my_ipn_redirect() { | |
if( defined('PMPRO_DIR') && $_SERVER['REQUEST_URI'] === '/mepr/notify/onibvz-5w6/ipn' ) { | |
require_once(PMPRO_DIR . "/services/ipnhandler.php"); | |
exit; | |
} | |
} | |
add_action('init', 'my_ipn_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment