Moving admin-ajax.php out of wp-admin?
-
We are developing custom plugins for wordpress. And many of them relies on admin-ajax.php to provide ajax capability. In our application, often times, SSL is only used in login and the admin panel. Other pages are forced to use HTTP. WordPress provides the convenient
FORCE_SSL_ADMIN
flag.However, when this flag is set,
admin_url('admin-ajax.php')
will return an HTTPS url. Calling https ajax url from http will fail. And the problem isn’t very obvious because the browser silently prevents this request (we are using chrome, and nginx as server). So we are forced to hard code'/wp-admin/admin-ajax.php'
into the script.I understand
admin_url
has a parameter to control scheme. But this is not good enough. It’s better to have an option for relative URL. Because we have custom login pages that uses ajax as well.I was hoping that the ajax api is provided without the admin context. But it appears that wordpress 3.6 beta 1 didn’t improve on this. Is it possible to move it out of the admin folder in a future update?
- The topic ‘Moving admin-ajax.php out of wp-admin?’ is closed to new replies.