Hi I am a WordPress and coding beginner and I am having trouble with hooking filters. This is the code in the parent theme:
'ajaxURL' => apply_filters( 'ae_ajax_url', admin_url( 'admin-ajax.php' ) ),
I want to hook that filter in such a way to replace the admin_url( 'admin-ajax.php' )
to admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ),
I tried many different ways and I cannot get it. Please help. This is one way I tried with no success:
add_filter( 'ae_ajax_url', 'admin_ajax_ssl' );
function admin_ajax_ssl() {
return admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
}
?>
Thanks in advance.