WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Купить персональные IPV4 и IPV6 прокси
функция не описана

Requests_Cookie::path_matches() WP 1.0

Check if a cookie is valid for a given path

From the path-match check in RFC 6265 section 5.1.4

Это метод класса: Requests_Cookie

Хуков нет.

Возвращает

true/false. Whether the cookie is valid for the given path

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

$Requests_Cookie = new Requests_Cookie();
$var = $Requests_Cookie->path_matches( $request_path );
$request_path(строка) (обязательный)
Path to check

Код Requests Cookie::path matches: wp-includes/Requests/Cookie.php WP 5.2.2

<?php
public function path_matches($request_path) {
	if (empty($request_path)) {
		// Normalize empty path to root
		$request_path = '/';
	}

	if (!isset($this->attributes['path'])) {
		// Cookies created manually; cookies created by Requests will set
		// the path to the requested path
		return true;
	}

	$cookie_path = $this->attributes['path'];

	if ($cookie_path === $request_path) {
		// The cookie-path and the request-path are identical.
		return true;
	}

	if (strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) {
		if (substr($cookie_path, -1) === '/') {
			// The cookie-path is a prefix of the request-path, and the last
			// character of the cookie-path is %x2F ("/").
			return true;
		}

		if (substr($request_path, strlen($cookie_path), 1) === '/') {
			// The cookie-path is a prefix of the request-path, and the
			// first character of the request-path that is not included in
			// the cookie-path is a %x2F ("/") character.
			return true;
		}
	}

	return false;
}