[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
Wed Jan 14 01:07:19 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 | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by nacin):
Interesting idea, but I don't think this function should have a filter.
It'd be like adding a filter to exit(), header(), json_encode(), or some
other low-level function. Its output should be expected based on its
input, ideally without filtration. It's not the right place, and it's also
easily abused (to the point of brokenness, for example).
The proper way to handle this would be for the plugin to add a specific
filter on the data before it sends it to the client.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31005#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list