So you have a wordpress blog and you (or your client) want the wp-admin to use an SSL certificate, sounds great! However, any AJAX you use in your site has broken. I spent a while googling this issue when it happened to me and found a really easy fix; you need to change the variables in the get_admin_url() function to force the AJAX requestion to use http instead of https. Change it to look like:
get_admin_url(null,'','http');
I hope this helps a lot of people!
March 3rd, 2012



Home



















June 2nd, 2012 at 14:06
Interesting! I am currently having problems with a website I am building, and where I added an SSL certificate. Since then, AJAX went bananas… In what file can I find the get_admin_url() function that I need to change?
June 2nd, 2012 at 15:49
Hi Kristof,
Normally, in the javascript for your AJAX call, there will be a url parameter.
I, prior to using SSL, would have a line that looked like so:
url: <?php echo get_admin_url(); ?>/admin-ajax.phpTo get this to work with SSL, I changed it to:
url: <?php echo get_admin_url(null,'','http); ?>/admin-ajax.phpI hope this helps.
Swifty