Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active June 23, 2017 20:53
Show Gist options
  • Save joshfeck/3ddccb8b3d859d8392f4 to your computer and use it in GitHub Desktop.
Save joshfeck/3ddccb8b3d859d8392f4 to your computer and use it in GitHub Desktop.
Add this to your WordPress website's custom functions plugin to make it so the return from PayPal page is https. Required: Event Espresso 4 and an SSL certificate installed for your domain.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter('_get_page_link','ee_paypal_return_https',10,2);
function ee_paypal_return_https($original_url,$post_id){
if (class_exists('EE_Registry')){
if(EE_Registry::instance()->CFG->core->thank_you_page_id == $post_id){
$original_url = str_replace("http://","https://",$original_url);
}
return $original_url;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment