mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Rest API: Ensure rest_ensure_response() upgrades WP_HTTP_Response to WP_REST_Response.
An instance of `WP_HTTP_Response` doesn't ensure that the required methods used in `WP_REST_Server::dispatch()` exist, currently causing a fatal error. Props ali11007, TimothyBlynJacobs, ocean90. Fixes #49495. git-svn-id: https://develop.svn.wordpress.org/trunk@47849 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -969,9 +969,9 @@ class WP_REST_Server {
|
||||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @param WP_HTTP_Response|WP_Error $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
|
||||
* @param array $handler Route handler used for the request.
|
||||
* @param WP_REST_Request $request Request used to generate the response.
|
||||
* @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
|
||||
* @param array $handler Route handler used for the request.
|
||||
* @param WP_REST_Request $request Request used to generate the response.
|
||||
*/
|
||||
$response = apply_filters( 'rest_request_before_callbacks', $response, $handler, $request );
|
||||
|
||||
@@ -1032,9 +1032,9 @@ class WP_REST_Server {
|
||||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @param WP_HTTP_Response|WP_Error $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
|
||||
* @param array $handler Route handler used for the request.
|
||||
* @param WP_REST_Request $request Request used to generate the response.
|
||||
* @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. Usually a WP_REST_Response or WP_Error.
|
||||
* @param array $handler Route handler used for the request.
|
||||
* @param WP_REST_Request $request Request used to generate the response.
|
||||
*/
|
||||
$response = apply_filters( 'rest_request_after_callbacks', $response, $handler, $request );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user