Changes between Initial Version and Version 2 of Ticket #64926
- Timestamp:
- 03/24/2026 01:30:34 PM (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #64926 – Description
initial v2 23 23 Until a core fix lands, the following filter coerces JSON-string GET params before validation runs: 24 24 25 {{{#!php 26 <?php 25 27 add_filter( 'rest_request_before_callbacks', function( $response, $handler, $request ) { 26 28 if ( 'GET' !== $request->get_method() ) { … … 41 43 return $response; 42 44 }, 10, 3 ); 45 }}} 43 46 44 47 The proper fix belongs in `rest_validate_value_from_schema()` in `wp-includes/rest-api.php`, mirroring the json_decode coercion already present in `rest_sanitize_value_from_schema()`.