WpOrg\Requests

Cookie::normalize()publicWP 1.0

Normalize cookie and attributes

Method of the class: Cookie{}

No Hooks.

Return

true|false. Whether the cookie was successfully normalized

Usage

$Cookie = new Cookie();
$Cookie->normalize();

Cookie::normalize() code WP 6.6.2

public function normalize() {
	foreach ($this->attributes as $key => $value) {
		$orig_value = $value;

		if (is_string($key)) {
			$value = $this->normalize_attribute($key, $value);
		}

		if ($value === null) {
			unset($this->attributes[$key]);
			continue;
		}

		if ($value !== $orig_value) {
			$this->attributes[$key] = $value;
		}
	}

	return true;
}