Created
August 14, 2013 09:36
-
-
Save jdevalk/6229430 to your computer and use it in GitHub Desktop.
Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise.
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
<?php | |
/** | |
* Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise. | |
* | |
* @param string $ajaxurl The current ajaxurl | |
* | |
* @return string | |
*/ | |
function yst_filter_edd_ajax_url( $ajaxurl ) { | |
if ( is_ssl() ) { | |
return $ajaxurl; | |
} else { | |
return str_replace( 'https://', 'http://', $ajaxurl ); | |
} | |
} | |
add_filter( 'edd_ajax_url', 'yst_filter_edd_ajax_url' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment