Make WordPress Core

Changeset 36536


Ignore:
Timestamp:
02/16/2016 06:05:02 AM (9 years ago)
Author:
rmccue
Message:

REST API: Apply rest_post_dispatch to embedded responses.

Fixes #35628.
Props @danielbachhuber.

File:
1 edited

Legend:

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

    r36535 r36536  
    341341         *
    342342         * @since 4.4.0
     343         * @since 4.5.0 Applied to embedded responses.
    343344         *
    344345         * @param WP_HTTP_Response $result  Result to send to the client. Usually a WP_REST_Response.
     
    567568                $request->set_query_params( $query_params );
    568569                $response = $this->dispatch( $request );
     570
     571                /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
     572                $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $this, $request );
    569573
    570574                $embeds[] = $this->response_to_data( $response, false );
Note: See TracChangeset for help on using the changeset viewer.