[wp-hackers] Plugins: Best practice for conditional loading of actions and file includes

Alex Hempton-Smith hempsworth at googlemail.com
Tue Feb 9 21:01:05 UTC 2010


Sorry if this is a basic question, but I'm working on an Ajax driven
plugin at the moment, and I'm using wp-load.pho and I now know I
shouldn't be! Especially since I'd like to release the plugin!

I'm enqueuing a js file, wherein it uses 'jQuery.post' to send data to
my plugin file. To process that request, I have an 'if (
isset($_POST))' which then includes wp-load.php, giving me access to
WP functions so I can process the request and echo the result.

Any tips on using Ajax in front-end plugins. there is a lot of
documentation on admin-ajax but not much on Ajax in plugins...

Many thanks,
Alex

-- 
-- Alex  (Hempsworth)


More information about the wp-hackers mailing list