I have an AJAX request that retrieves information from a function I coded in my own plugin, here is how I set the ajax function:
function my_ajax_function () {
do_action('my_plugin_function');
}
add_action('wp_ajax_do_ajax', 'my_ajax_function');
Complete file code at this link, will be temporarily available until we get a reply, I commented the line where the request fails, hope it helps:
http://www.pokebeach.com/code.txt
In the jQuery script I'm able to do the AJAX call but it is returning nothing and it seems that my plugin is not loaded when calling the functions via AJAX, also I know the functions work correctly because I use them in other places in the website where they return the proper data, is there any configuration or something to do with this, so the plugin works with the AJAX requests?
Thanks!
do_action()
does not return a value you couldecho
. Does it work when you echo a string? See also Debug AJAX.