category: wordpress plugins

22
APR
2010
13
APR
2010

When you are writing a plugin that uses Ajax in the front end, you must use:

add_action( 'wp_ajax_nopriv_<ACTION NAME>', <YOUR FUNCTION> );

…as doing…

add_action( 'wp_ajax_<ACTION NAME>', <YOUR FUNCTION> );

… is only for logged in users. So if you have a plugin that operates no matter which way users interface with the plugin, you must provide both action calls to make sure it all gets processed. Helpful tip. :)

Will be back shortly…