On this page
WP_HTTP_IXR_Client::__construct( string $server, string|false $path = false, int|false $port = false, int $timeout = 15 )
Parameters
$serverstring Required$pathstring|false Optional-
Default:
false $portint|false Optional-
Default:
false $timeoutint Optional-
Default:
15
Source
File: wp-includes/class-wp-http-ixr-client.php. View all references
public function __construct( $server, $path = false, $port = false, $timeout = 15 ) {
if ( ! $path ) {
// Assume we have been given a URL instead.
$bits = parse_url( $server );
$this->scheme = $bits['scheme'];
$this->server = $bits['host'];
$this->port = isset( $bits['port'] ) ? $bits['port'] : $port;
$this->path = ! empty( $bits['path'] ) ? $bits['path'] : '/';
// Make absolutely sure we have a path.
if ( ! $this->path ) {
$this->path = '/';
}
if ( ! empty( $bits['query'] ) ) {
$this->path .= '?' . $bits['query'];
}
} else {
$this->scheme = 'http';
$this->server = $server;
$this->path = $path;
$this->port = $port;
}
$this->useragent = 'The Incutio XML-RPC PHP Library';
$this->timeout = $timeout;
}
Related
Used By
| Used By | Description |
|---|---|
| weblog_ping() wp-includes/comment.php | Sends a pingback. |
| pingback() wp-includes/comment.php | Pings back the links found in a post. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_ixr_client/__construct