From 66fc70f0e1163383490e44fd50624585e6c48fc7 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Tue, 16 Feb 2016 04:40:01 +0000 Subject: [PATCH] REST API: Add routing args to rest_dispatch_request filter. This allows requests to be hijacked via the filter more easily. Fixes #35507. git-svn-id: https://develop.svn.wordpress.org/trunk@36534 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/rest-api/class-wp-rest-server.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 98f174e9d5..5672cd39dd 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -874,11 +874,14 @@ class WP_REST_Server { * Allow plugins to override dispatching the request. * * @since 4.4.0 + * @since 4.5.0 $route and $handler parameters added. * * @param bool $dispatch_result Dispatch result, will be used if not empty. * @param WP_REST_Request $request Request used to generate the response. + * @param string $route Route matched for the request. + * @param array $handler Route handler used for the request. */ - $dispatch_result = apply_filters( 'rest_dispatch_request', null, $request ); + $dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler ); // Allow plugins to halt the request via this filter. if ( null !== $dispatch_result ) {