Skip to content

Commit

Permalink
Consistently refer to the inner request as
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyBJacobs committed Sep 15, 2020
1 parent 7471d6d commit 47edcf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/class-wp-rest-batch-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ public function serve_batch_request( WP_REST_Request $batch_request ) {
);
}

foreach ( $requests as $i => $batch_request ) {
$clean_request = clone $batch_request;
foreach ( $requests as $i => $single_request ) {
$clean_request = clone $single_request;
$clean_request->set_url_params( array() );
$clean_request->set_attributes( array() );
$clean_request->set_default_params( array() );
Expand Down Expand Up @@ -212,12 +212,12 @@ public function serve_batch_request( WP_REST_Request $batch_request ) {
);
}

$result = rest_get_server()->respond_to_request( $batch_request, $route, $handler, $error );
$result = rest_get_server()->respond_to_request( $single_request, $route, $handler, $error );
}
}

/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
$result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), rest_get_server(), $batch_request );
$result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), rest_get_server(), $single_request );

$responses[] = rest_get_server()->envelope_response( $result, false )->get_data();
}
Expand Down

0 comments on commit 47edcf6

Please sign in to comment.