W3cubDocs

/WordPress

Cookie::normalize(): boolean

Normalize cookie and attributes

Return

boolean Whether the cookie was successfully normalized

Source

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

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wporg-requests-cookie/normalize