mysql - update_option returns false in AJAX, how to debug?

I tried debug plugins for WordPress, but they only show the current page SQL queries. How to debug if update_option retu

I tried debug plugins for WordPress, but they only show the current page SQL queries. How to debug if update_option returns false?

I am updating an object decoded from AJAX request with json_decode although I doubt it has anything to do with it.

I tried debug plugins for WordPress, but they only show the current page SQL queries. How to debug if update_option returns false?

I am updating an object decoded from AJAX request with json_decode although I doubt it has anything to do with it.

Share Improve this question edited Jan 13, 2019 at 22:20 butlerblog 5,1313 gold badges28 silver badges44 bronze badges asked Jan 13, 2019 at 16:10 AurimasAurimas 1013 bronze badges 2
  • 3 it would be helpful to see code, something we can test, or anything.... – Milo Commented Jan 13, 2019 at 16:18
  • 1 Can you add the code where you register your ajax request handlers, the ajax function code and also the script where you actually call the action function. – Cyclonecode Commented Jan 13, 2019 at 17:49
Add a comment  | 

1 Answer 1

Reset to default 0

I found out that my settings where filtered by validation function registered by register_setting. Somehow I thought that it would only affect settings that where going through wordpress's own settings fields and not a custom AJAX function (the way I have it setup).

To the point of the question: I used php exit to debug the AJAX. update_option returned false because the options fields where the same after validation (I was missing out one particular setting)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745564614a4633316.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信