ACF_Rest_Request::set_url_params
Loop through supported routes to find matching pattern. Use matching pattern to determine any URL parameters.
Method of the class: ACF_Rest_Request{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->set_url_params();
ACF_Rest_Request::set_url_params() ACF Rest Request::set url params code ACF 6.8.8
private function set_url_params() {
if ( ! $this->supported_routes || ! is_string( $this->current_route ) ) {
return;
}
// Determine query args passed within the URL.
foreach ( $this->supported_routes as $route ) {
$match = preg_match( '@^' . $route . '$@i', $this->current_route, $matches );
if ( ! $match ) {
continue;
}
foreach ( $matches as $param => $value ) {
if ( ! is_int( $param ) ) {
$this->url_params[ $param ] = $value;
}
}
}
}