Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make sure the AJAX URL for EDD uses the protocol for the current page, either http or https, as it doesn't work otherwise.
<?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
You can’t perform that action at this time.