[wp-hackers] ajax to call function in theme

Austin Matzko if.website at gmail.com
Thu Oct 29 20:05:22 UTC 2009


On Thu, Oct 29, 2009 at 3:02 PM, Otto <otto at ottodestruct.com> wrote:
> Let me guess: You put this server side code into some separate PHP
> file somewhere, and now are calling that PHP file directly from your
> AJAX call, yes?
>
> I suggest you re-read that tutorial, because that's exactly what you
> *don't* do, and the tutorial explains why.

Unfortunately, the tutorial *does* suggest that very thing for the
modified example:

> We need to send our request to a plugin PHP file. This could be the main plugin PHP file, or a separate PHP file. It's probably a little cleaner to do it in a separate file, which we'll assume is called "myplugin_ajax.php", located in the standard wp-content/plugins directory of Wordpress.


More information about the wp-hackers mailing list