WORDPRESS – ADMIN AJAX REQUEST ALWAYS RETURN 0 EVEN WITH DIE()

0 39

WordPress offers a great way for theme and plugin developers to add functionality using AJAX and with the use of their API your theme and plugin works smoothly but wait what this AJAX mean? AJAX is stands for Asynchronous JavaScript and XML and AJAX is not a new programming language, but a new way to use existing standards, okay so much for that.

So you’re working in Worpress AJAX huh? Last week I’m working on my plugin and I’m using AJAX on it, all fine the code, the callback function, everything and I began to scratch my head, why I only got zero response? Luck for you mate I will share you the fix.

Solution 1:

Make sure that you’re calling the action properly in your PHP file, a sample action declaration inside in your JS file.

JS File

You might also like More from author

Leave A Reply

Your email address will not be published.