Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Forked from ideadude/my_ipn_redirect.php
Created December 17, 2024 12:11
Show Gist options
  • Save JarrydLong/29c41f081681b57430dbf7ce3a25ef70 to your computer and use it in GitHub Desktop.
Save JarrydLong/29c41f081681b57430dbf7ce3a25ef70 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