[wp-hackers] wp-admin folder and admin-ajax.php

Peter Westwood peter.westwood at ftwr.co.uk
Wed Aug 11 10:49:17 UTC 2010


On 11 Aug 2010, at 10:14, Gavin Pearce wrote:

> Thanks Westi!
> 
> Out of interest then, and in that case - how would you personally best
> handle non-auth, front-end, AJAX (and then having access to the various
> WP instances/classes/DB) without hooking into the WordPress AJAX
> function at admin-ajax.php?
> 
> All the main guides seem to point towards using admin-ajax ...
> 

Sorry I missed this out my response earlier.

For unauthenticated actions use a no_priv action hook.

Line 46 of admin-ajax.php

do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );

westi
-- 
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5



More information about the wp-hackers mailing list