Skip to content

Instantly share code, notes, and snippets.

@ideadude
Created February 23, 2018 13:00
Show Gist options
  • Save ideadude/58bc71fb5b811a39592279b6e5687872 to your computer and use it in GitHub Desktop.
Save ideadude/58bc71fb5b811a39592279b6e5687872 to your computer and use it in GitHub Desktop.
Redirect MEPR IPN URL to the PMPro IPN URL
/*
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