最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp admin - Hi everyone, I have Problem with using wp_die()

programmeradmin2浏览0评论

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
  • 3 Can you please share your code. Without code, nobody can understand what was wrong that is triggering this. BTW, if anything is strictly for front end only, a conditional like 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
  • Where is that in 'view source' in your browser? I'd guess you're actually generating it first, before the HTML? – Rup Commented Mar 5, 2020 at 20:00
Add a comment  | 

1 Answer 1

Reset to default 0

I used Class to embed functions in function.php file. And also used namespace to call ajax requests. So no conflicts in displaying messages

发布评论

评论列表(0)

  1. 暂无评论