From 368e28243f59b1795d3fedbed08163a232760578 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 22 Aug 2016 20:55:29 +0000 Subject: [PATCH] REST API: remove unnecessary variable assignments in `rest_handle_options_request()`. See #37771. git-svn-id: https://develop.svn.wordpress.org/trunk@38310 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/rest-api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 13bfa596ec..0eee75c772 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -421,10 +421,8 @@ function rest_handle_options_request( $response, $handler, $request ) { $response = new WP_REST_Response(); $data = array(); - $accept = array(); - foreach ( $handler->get_routes() as $route => $endpoints ) { - $match = preg_match( '@^' . $route . '$@i', $request->get_route(), $args ); + $match = preg_match( '@^' . $route . '$@i', $request->get_route() ); if ( ! $match ) { continue;