I want add AJAX support to my plugin and I have huge problem with this simple thing. WordPress isn\'t permitting me to use normal AJAX and I need to use WordPress version.
I see few problems here. Action should inside the data object, not as a jQuery Ajax parameter. Also in the callback function data is stored in $_POST variable.
function test_callback() {
$whatever = $_POST['whatever'];
echo $whatever;
die();
}
add_action('wp_ajax_nopriv_fqtag', 'test_callback');
add_action('wp_ajax_fqtag', 'test_callback');
function print_js() {
?>