ACF_Rest_Request::set_url_params()privateACF 1.0

Loop through supported routes to find matching pattern. Use matching pattern to determine any URL parameters.

Метод класса: ACF_Rest_Request{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->set_url_params();

Код ACF_Rest_Request::set_url_params() ACF 6.0.4

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;
			}
		}
	}
}