[wp-trac] [WordPress Trac] #29435: wp_send_json() & co. should support json_encode()'s optional arguments

WordPress Trac noreply at wordpress.org
Sun Oct 26 01:20:37 UTC 2014


#29435: wp_send_json() & co. should support json_encode()'s optional arguments
-----------------------------+------------------------------
 Reporter:  Viper007Bond     |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Gallery          |     Version:  3.9.2
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:
-----------------------------+------------------------------

Comment (by adamsilverstein):

 Replying to [comment:7 nacin]:
 > To be honest, this doesn't seem like something I find particularly
 necessary. It adds unnecessary complexity to a dead-simple utility
 function.
 >
 > At most, we could pass JSON_PRETTY_PRINT when WP_DEBUG. But I'd be more
 inclined to just suggest a change in your debugging in such a way that
 your browser handles this for you — and better than just whitespace. In
 Chrome, there's a popular extension for turning JSON into a collapsable
 tree. Viewing an XHR request in the inspector also gives you a full
 preview that is, again, an expandable tree.

 Makes sense to me, especially for debugging - and agree it adds
 unnecessary complexity. Wondering if any of the other
 [http://php.net/manual/en/json.constants.php predefined constants] would
 be useful?

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


More information about the wp-trac mailing list