WC_REST_Authentication::resolved_route
The route WordPress resolved for this request, trimmed of surrounding slashes.
Null when WordPress has not parsed the request yet, which is not the same as an empty route.
Method of the class: WC_REST_Authentication{}
No Hooks.
Returns
string|null.
Usage
// private - for code of main (parent) class only $result = $this->resolved_route(): ?string;
WC_REST_Authentication::resolved_route() WC REST Authentication::resolved route code WC 11.1.2
private function resolved_route(): ?string {
global $wp;
if ( ! $wp instanceof WP || ! isset( $wp->query_vars['rest_route'] ) || ! is_string( $wp->query_vars['rest_route'] ) ) {
return null;
}
return trim( $wp->query_vars['rest_route'], '/' );
}