I have created a custom registration form in WordPress and everything works fine. The error handling and database operations also fine.
The only problem is that the JSON response I return is printed on all pages in WordPress including admin account, dashboard, pages, and all posts. I have looked for in it google, the only thing I got is to use wp_die() if I use this wp_die() at end of my functions.php files function I get a white page without issue resolved.
Can anyone know any solution for this? I have attached the screenshot of the WordPress dashboard.
I have created a custom registration form in WordPress and everything works fine. The error handling and database operations also fine.
The only problem is that the JSON response I return is printed on all pages in WordPress including admin account, dashboard, pages, and all posts. I have looked for in it google, the only thing I got is to use wp_die() if I use this wp_die() at end of my functions.php files function I get a white page without issue resolved.
Can anyone know any solution for this? I have attached the screenshot of the WordPress dashboard.
Share Improve this question edited Mar 5, 2020 at 13:18 sleepingpanda 566 bronze badges asked Mar 5, 2020 at 4:19 Kalpana RKalpana R 13 bronze badges 2 |1 Answer
Reset to default 0I used Class to embed functions in function.php file. And also used namespace to call ajax requests. So no conflicts in displaying messages
if (! is_admin() ) { // do something; }
could do the trick. BTW this is not a solution here. – Mayeenul Islam Commented Mar 5, 2020 at 4:50