{"action":"created","issue":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/2251","repository_url":"https://api.github.com/repos/WP-API/WP-API","labels_url":"https://api.github.com/repos/WP-API/WP-API/issues/2251/labels{/name}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/2251/comments","events_url":"https://api.github.com/repos/WP-API/WP-API/issues/2251/events","html_url":"https://github.com/WP-API/WP-API/issues/2251","id":132521711,"number":2251,"title":"Pass $options to wp_json_encode","user":{"login":"cjhaas","id":7748460,"avatar_url":"https://avatars.githubusercontent.com/u/7748460?v=3","gravatar_id":"","url":"https://api.github.com/users/cjhaas","html_url":"https://github.com/cjhaas","followers_url":"https://api.github.com/users/cjhaas/followers","following_url":"https://api.github.com/users/cjhaas/following{/other_user}","gists_url":"https://api.github.com/users/cjhaas/gists{/gist_id}","starred_url":"https://api.github.com/users/cjhaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjhaas/subscriptions","organizations_url":"https://api.github.com/users/cjhaas/orgs","repos_url":"https://api.github.com/users/cjhaas/repos","events_url":"https://api.github.com/users/cjhaas/events{/privacy}","received_events_url":"https://api.github.com/users/cjhaas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-09T20:13:26Z","updated_at":"2016-02-09T20:47:25Z","closed_at":"2016-02-09T20:47:25Z","body":"It would be nice to have a filter to set the second parameter of `wp_json_encode` so that implementors could optionally provide `$options` to `json_encode`. In my specific case, while I'm debugging it would really nice to have `JSON_PRETTY_PRINT` available.\r\n\r\nSomething like changing:\r\n\r\n    $result = wp_json_encode( $result );\r\n\r\nTo:\r\n\r\n    $result = wp_json_encode( $result, apply_filters( 'rest_json_encode_options', 0 ) ) ;\r\n\r\nPossibly adding the $depth parameter as a filter, too, and also applying this to the two other return areas."},"comment":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/comments/182057591","html_url":"https://github.com/WP-API/WP-API/issues/2251#issuecomment-182057591","issue_url":"https://api.github.com/repos/WP-API/WP-API/issues/2251","id":182057591,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T20:47:25Z","updated_at":"2016-02-09T20:47:25Z","body":"Thanks for the request, @cjhaas !\r\n\r\nOur infrastructure was committed to WordPress core in 4.4, so any feature requests or bug reports against it need to be filed in Trac: https://core.trac.wordpress.org/"}}