REST API: Pass WP_REST_Request object to the rest_index filter.

Props johnregan3, TimothyBlynJacobs, Spacedmonkey, hasanuzzamanshamim.
Fixes #48638. 


git-svn-id: https://develop.svn.wordpress.org/trunk@52796 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonny Harris 2022-02-24 22:34:56 +00:00
parent 16cd22183d
commit f4addf3ff5

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