Redirect wp-members IPN URL to the PMPro IPN URL
This file contains 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 wp-members IPN URL to the PMPro IPN URL, e.g. | |
https://yoursite.com/?_wpm_gateway=paypal&_wpm_action=ipn => | |
https://yoursite.com/wp-admin/admin-ajax.php?action=ipnhandler | |
*/ | |
function my_ipn_redirect() { | |
if(!empty($_REQUEST['_wpm_gateway']) && !empty($_REQUEST['_wpm_action']) && defined('PMPRO_DIR')) | |
{ | |
if($_REQUEST['_wpm_gateway'] == "paypal" && $_REQUEST['_wpm_action'] == "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