[wp-hackers] AJAX for the frontend

Tynan Colin Beatty junsuijin at gmail.com
Thu Sep 17 16:32:07 UTC 2009


I think there is an undocumented 'wp_ajax_nopriv' hook you may want to look
at. I've not any experience in using it yet, so I can't be more specific
than that.
peace~

On Thu, Sep 17, 2009 at 11:27 AM, Expert IT Dude
<expert.it.dude at gmail.com>wrote:

> "Implementing Ajax on the viewer-facing side of a WordPress site is
> slightly more ad-hoc than doing Ajax on the administration side,
> because WordPress itself doesn't have viewer-facing Ajax built in"
> (http://codex.wordpress.org/AJAX_in_Plugins)
>
> 'Slightly' is a gross understatement. Let's call this what it actually
> is: A hack. Spent half a day hunting for an AJAX interface in the WP
> front-end and discovered it doesn't exist.
>
> It would literally only be about 50 lines or so of code to write a
> wp-ajax.php file for the root WP directory that has a singular hook
> that plugins could utilize for a callback. Even if the WP frontend
> doesn't ever use it, plugins could cleanly and consistently leverage
> the hooking interface for whatever AJAX they want on the frontend. It
> would pretty much be a copy-and-paste from the admin-ajax.php script
> (with maybe a couple changes to wp-settings.php), is something a core
> WP developer could crank out in an evening, and would save us plugin
> developers a major headache. We could then just simply use
> jQuery.load('wp-ajax.php', {...}); (or similar) from wherever and,
> bam!, instant AJAX support for our plugins on the frontend complete
> with a clean hooking interface similar to what admin-side AJAX plugins
> already have.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list