I can't figure out why nothing is returned I am a real beginner in Ajax .. I just read a lot of topics about using Ajax in Woprdpress but the examples are super advanced for me H
Solution 1:
You can't use return in your AJAX callback. The code never gets to die on the line beneath. You need to echo the value instead and then use wp_die().
Replace:
return $id;
die();
With:
echo $id;
wp_die();
Share
Post a Comment
for "The Wordpress Ajax Request Returns 0"
Post a Comment for "The Wordpress Ajax Request Returns 0"