apply_filters( 'rest_json_encode_options', int $options, WP_REST_Request $request )
- Since
- 6.1.0
Filters the JSON encoding options used to send the REST API response.
Compatibility
- WordPress
- since 6.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$optionsint- JSON encoding options json_encode().
$requestWP_REST_Request- Current request object.
Where this hook fires · 1
wp-includes/rest-api/class-wp-rest-server.php:266WP_REST_Server::get_json_encode_options()
Source code
* * @since 6.1.0 * * @param int $options JSON encoding options {@see json_encode()}. * @param WP_REST_Request $request Current request object. */ return apply_filters( 'rest_json_encode_options', $options, $request ); } /** * Handles serving a REST API request. * * Matches the current server URI to a route and runs the first matchingChangelog
Introduced in 6.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.