Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
73367f48
Commit
73367f48
authored
Apr 12, 2017
by
Erick Hitter
Browse files
Improve plugin performance
parent
8f7d9d3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/functions.php
View file @
73367f48
...
...
@@ -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
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment