From 2ae4784ca0aa4ba0e8e87d9c7c1c22f26b214701 Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Thu, 24 Feb 2022 22:36:01 +0000 Subject: [PATCH] REST API: Pass `WP_REST_Request` object to the rest_index filter. Props johnregan3, TimothyBlynJacobs, Spacedmonkey, hasanuzzamanshamim. Fixes #48638. Built from https://develop.svn.wordpress.org/trunk@52796 git-svn-id: http://core.svn.wordpress.org/trunk@52385 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index a14c20cfa4..056447f545 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -1239,10 +1239,12 @@ class WP_REST_Server { * available on the API, and a small amount of data about the site. * * @since 4.4.0 + * @since 6.0.0 Added `$request` parameter. * * @param WP_REST_Response $response Response data. + * @param WP_REST_Request $request Request data. */ - return apply_filters( 'rest_index', $response ); + return apply_filters( 'rest_index', $response, $request ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 8beec4dd60..7923403305 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52795'; +$wp_version = '6.0-alpha-52796'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.