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
This commit is contained in:
spacedmonkey 2022-02-24 22:36:01 +00:00
parent 631f08096b
commit 2ae4784ca0
2 changed files with 4 additions and 2 deletions

View File

@ -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 );
}
/**

View File

@ -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.