WP_Network::_set_cookie_domain()privateWP 4.4.0

Sets the cookie domain based on the network domain if one has not been populated.

Method of the class: WP_Network{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->_set_cookie_domain();

Changelog

Since 4.4.0 Introduced.

WP_Network::_set_cookie_domain() code WP 6.5.2

private function _set_cookie_domain() {
	if ( ! empty( $this->cookie_domain ) ) {
		return;
	}

	$this->cookie_domain = $this->domain;
	if ( str_starts_with( $this->cookie_domain, 'www.' ) ) {
		$this->cookie_domain = substr( $this->cookie_domain, 4 );
	}
}