Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangerstudios/cccf8144ca2f2a1e41d2 to your computer and use it in GitHub Desktop.
Save strangerstudios/cccf8144ca2f2a1e41d2 to your computer and use it in GitHub Desktop.
Redirect wp-members IPN URL to the PMPro IPN URL
/*
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