[wp-trac] [WordPress Trac] #28978: wp_send_json_error() should support WP_Error objects

WordPress Trac noreply at wordpress.org
Fri Sep 12 05:34:53 UTC 2014


#28978: wp_send_json_error() should support WP_Error objects
---------------------------------------------+----------------------------
 Reporter:  danielbachhuber                  |       Owner:  paulschreiber
     Type:  enhancement                      |      Status:  assigned
 Priority:  normal                           |   Milestone:  4.1
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  good-first-bug has-patch commit  |     Focuses:
---------------------------------------------+----------------------------
Changes (by nacin):

 * keywords:  good-first-bug has-patch => good-first-bug has-patch commit
 * milestone:  Future Release => 4.1


Comment:

 This looks good to me. Anyone else?

 Not sure if intentional, but I think I agree with omitting error data.
 Codes and messages are simple strings, while error data can be basically
 anything and that may not translate well to JSON. In core, the data is a
 another WP_Error in some cases (like in updates).

 We can always add error data later as it'd be just another key in the
 object. Just thinking about forwards compatibility.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28978#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list