} foreach ( $endpoints as $endpoint ) { // Remove the redundant preg_match() argument.
unset( $args[0
] );
$request->
set_url_params( $args );
$request->
set_attributes( $endpoint );
} $data =
$handler->
get_data_for_route( $route,
$endpoints, 'help'
);
$response->
set_matched_route( $route );
break;
} $response->
set_data( $data );
return $response;
}/**
* Sends the "Allow" header to state all methods that can be sent to the current route.
*
* @since 4.4.0
*
* @param WP_REST_Response $response Current response being served.
* @param WP_REST_Server $server ResponseHandler instance (usually WP_REST_Server).
* @param WP_REST_Request $request The request that was used to make current response.
* @return WP_REST_Response Response to be served, with "Allow" header if route has allowed methods.
*/