[wp-trac] [WordPress Trac] #31005: wp_send_json(): Filtering of $response prior to passing it to wp_json_encode().

WordPress Trac noreply at wordpress.org
Tue Jan 13 22:35:09 UTC 2015


#31005: wp_send_json(): Filtering of $response prior to passing it to
wp_json_encode().
-------------------------+-----------------------------
 Reporter:  ap.0         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  4.1
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 It would be nice if wp_send_json() allowed $response to be filtered prior
 to passing it to wp_json_encode() and echo'ing the resulting JSON.

 I'm working with a theme that uses wp_send_json() while responding to AJAX
 requests. I'd like to modify/customize the response content, however,
 without modifying the theme itself (which doesn't appear to have other
 hooks that could be used).

 wp_send_json() seems to be a convenient and reasonable place to perform
 such filtering, but doesn't already appear to support this as of 4.1.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31005>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list