I am developing a WP Plugin.
Currently, I am making an ajax call with jquery to a standalone php file in my plugin folder.
Let's presume that this file is called test.php.
The file is NOT loaded prior to this call, so no native wordpress functions work in this file.
As a result, I have require_once('wp.load');
in test.php.
Here stems my questions:
The only function I need from wordpress is $wpdb->insert. Is there a better function to include than wp-load? Something that doesn't include so much, since all I need is this one function!
I understand that require_once loads the file, ONLY if it hasn't been loaded yet. Maybe I'm overlooking the situation, but how does this work with ajax? If there is a "success" response, does test.php close, thus when its called again, it loads
wp-load.php
again?
Thanks!