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

Requests_Cookie::domain_matches() WP 1.0

Check if a cookie is valid for a given domain

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

Хуков нет.

Возвращает

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

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

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

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

<?php
public function domain_matches($string) {
	if (!isset($this->attributes['domain'])) {
		// Cookies created manually; cookies created by Requests will set
		// the domain to the requested domain
		return true;
	}

	$domain_string = $this->attributes['domain'];
	if ($domain_string === $string) {
		// The domain string and the string are identical.
		return true;
	}

	// If the cookie is marked as host-only and we don't have an exact
	// match, reject the cookie
	if ($this->flags['host-only'] === true) {
		return false;
	}

	if (strlen($string) <= strlen($domain_string)) {
		// For obvious reasons, the string cannot be a suffix if the domain
		// is shorter than the domain string
		return false;
	}

	if (substr($string, -1 * strlen($domain_string)) !== $domain_string) {
		// The domain string should be a suffix of the string.
		return false;
	}

	$prefix = substr($string, 0, strlen($string) - strlen($domain_string));
	if (substr($prefix, -1) !== '.') {
		// The last character of the string that is not included in the
		// domain string should be a %x2E (".") character.
		return false;
	}

	// The string should be a host name (i.e., not an IP address).
	return !preg_match('#^(.+\.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $string);
}