Make WordPress Core

Changeset 36534


Ignore:
Timestamp:
02/16/2016 04:40:01 AM (9 years ago)
Author:
rmccue
Message:

REST API: Add routing args to rest_dispatch_request filter.

This allows requests to be hijacked via the filter more easily.

Fixes #35507.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r36533 r36534  
    875875                     *
    876876                     * @since 4.4.0
     877                     * @since 4.5.0 $route and $handler parameters added.
    877878                     *
    878879                     * @param bool            $dispatch_result Dispatch result, will be used if not empty.
    879880                     * @param WP_REST_Request $request         Request used to generate the response.
     881                     * @param string          $route           Route matched for the request.
     882                     * @param array           $handler         Route handler used for the request.
    880883                     */
    881                     $dispatch_result = apply_filters( 'rest_dispatch_request', null, $request );
     884                    $dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler );
    882885
    883886                    // Allow plugins to halt the request via this filter.
Note: See TracChangeset for help on using the changeset viewer.