WpOrg\Requests

Iri::set_scheme()protectedWP 1.0

Set the scheme. Returns true on success, false on failure (if there are any invalid characters).

Method of the class: Iri{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_scheme( $scheme );
$scheme(string) (required)
-

Iri::set_scheme() code WP 6.6.2

protected function set_scheme($scheme) {
	if ($scheme === null) {
		$this->scheme = null;
	}
	elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) {
		$this->scheme = null;
		return false;
	}
	else {
		$this->scheme = strtolower($scheme);
	}
	return true;
}