Ticket #43691: 43691-2.diff
File 43691-2.diff, 740 bytes (added by , 4 years ago) |
---|
-
src/wp-includes/rest-api/class-wp-rest-server.php
401 401 */ 402 402 $result = apply_filters( 'rest_pre_echo_response', $result, $this, $request ); 403 403 404 // The 204 response shouldn't have a body. 405 if ( $code === 204 ) { 406 return null; 407 } 408 409 if ( $result === null ) { 410 _doing_it_wrong( __FUNCTION__, __( 'The response doesn\'t contain a body, which was expected to be there.' ), '5.3' ); 411 } 412 404 413 $result = wp_json_encode( $result ); 405 414 406 415 $json_error_message = $this->get_json_last_error();