diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 7511c100ed..0a3b1c82bf 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -349,6 +349,9 @@ class WP_Http { try { $response = Requests::request( $url, $headers, $data, $type, $options ); + + // Convert the response into an array + $response = new WP_HTTP_Requests_Response( $response, $r['filename'] ); } catch ( Requests_Exception $e ) { $response = new WP_Error( 'http_request_failed', $e->getMessage() ); @@ -382,19 +385,16 @@ class WP_Http { ); } - // Convert the response into an array - $data = new WP_HTTP_Requests_Response( $response, $r['filename'] ); - /** * Filter the HTTP API response immediately before the response is returned. * * @since 2.9.0 * - * @param array $data HTTP response. - * @param array $r HTTP request arguments. - * @param string $url The request URL. + * @param array $response HTTP response. + * @param array $r HTTP request arguments. + * @param string $url The request URL. */ - return apply_filters( 'http_response', $data, $r, $url ); + return apply_filters( 'http_response', $response, $r, $url ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index d9b69e9341..fbce6205b7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37435'; +$wp_version = '4.6-alpha-37436'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.