WordPress/wp-includes/rest-api
K. Adam White bd607c1118 REST API: Introduce _pretty query parameter to opt in to JSON_PRETTY_PRINT.
Add support for a "_pretty" meta-parameter on all REST controllers which instructs WordPress to return pretty-printed JSON, for better readability when inspecting endpoint responses in curl output or certain developer tools.

Introduce the "rest_json_encode_options" filter to permit site owners to control this behavior globally.

Props Viper007Bond, TimothyBlynJacobs, chrisguitarguy, johnbillion, swissspidy, adamsilverstein, danielbachhuber, rmccue.
Fixes #41998.

Built from https://develop.svn.wordpress.org/trunk@54127


git-svn-id: http://core.svn.wordpress.org/trunk@53686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:02:09 +00:00
..
endpoints REST API: Add support for searching resources by id. 2022-09-11 21:12:11 +00:00
fields REST API: Update “object” strings to use the appropriate nouns. 2021-05-25 13:12:58 +00:00
search REST API: Add support for searching resources by id. 2022-09-11 21:12:11 +00:00
class-wp-rest-request.php Code Modernization: Silence the deprecation warnings for missing return type in `WP_REST_Request`. 2021-08-03 11:08:56 +00:00
class-wp-rest-response.php Docs: Update spelling for inline comments in a few files. 2022-01-25 13:55:05 +00:00
class-wp-rest-server.php REST API: Introduce _pretty query parameter to opt in to JSON_PRETTY_PRINT. 2022-09-11 22:02:09 +00:00