Front-end ajax handler
|Reported by:||prettyboymp||Owned by:|
Just wanted to start a discussion on ajax handling for requests from the front-end (non-admin) of the site. There are a couple of things I've come across with this:
First is using admin-ajax.php causes problems if you have the admin running under a different domain than the front-end. Using site_url instead of admin_url fixes the issue with cross site ajax posts, but you still may have to add some extra handling to keep the admin from redirecting to the admin's domain. Extra steps that I think could be easily resolved.
I'm curious as to what other developers do, or if anyone feels we should add separate handling for front-end ajax along with a built in enqueueable script that sets the ajax url. I'm