Skip to content

Commit

Permalink
REST API: Remove unused variable in `WP_REST_Server::match_request_to…
Browse files Browse the repository at this point in the history
…_handler()`.

Previously initialized in `WP_REST_Server::dispatch()`, the `$response` variable became unused when the logic was split into two new methods, `::match_request_to_handler()` and `::respond_to_request()`.

Follow-up to [34928], [48947].

Props upadalavipul, mukesh27.
Fixes #59420.

git-svn-id: https://develop.svn.wordpress.org/trunk@56645 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov authored and pull[bot] committed Feb 5, 2024
1 parent 02405ba commit e789b1f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,6 @@ protected function match_request_to_handler( $request ) {

foreach ( $handlers as $handler ) {
$callback = $handler['callback'];
$response = null;

// Fallback to GET method if no HEAD method is registered.
$checked_method = $method;
Expand Down

0 comments on commit e789b1f

Please sign in to comment.