On this page
Requests_IRI::set_port( string $port ): bool
Set the port. Returns true on success, false on failure (if there are any invalid characters).
Parameters
$portstring Required
Return
bool
Source
File: wp-includes/Requests/IRI.php. View all references
protected function set_port($port) {
if ($port === null) {
$this->port = null;
return true;
}
if (strspn($port, '0123456789') === strlen($port)) {
$this->port = (int) $port;
$this->scheme_normalization();
return true;
}
$this->port = null;
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| Requests_IRI::scheme_normalization() wp-includes/Requests/IRI.php |
Used By
| Used By | Description |
|---|---|
| Requests_IRI::set_authority() wp-includes/Requests/IRI.php | Set the authority. Returns true on success, false on failure (if there are any invalid characters). |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_iri/set_port