Commit 73367f48 authored by Erick Hitter's avatar Erick Hitter
Browse files

Improve plugin performance

parent 8f7d9d3c
......@@ -34,10 +34,16 @@ function is_rest_endpoint_request( $type = 'list' ) {
return false;
}
// Hold onto request since it won't change
static $request = null;
if ( is_null( $request ) ) {
$request = parse_request();
}
// Build the full endpoint and check against the current request
$run_endpoint = sprintf( '%s/%s/%s', rest_get_url_prefix(), REST_API::API_NAMESPACE, $endpoint );
return in_array( $run_endpoint, parse_request(), true );
return in_array( $run_endpoint, $request, true );
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment