wppaste
WordPress

WP_HTTP_IXR_Client

Since
3.1.0
Source
wp-includes/class-wp-http-ixr-client.php:8
WP_HTTP_IXR_Client

Compatibility

WordPress
since 3.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside WP_HTTP_IXR_Client, in the order it appears in the class, grouped by the method that fires it.

Properties · 2

$schemepublic
$errorIXR_Errorpublic

Methods · 2

Source code

#[AllowDynamicProperties]class WP_HTTP_IXR_Client extends IXR_Client {	public $scheme;	/**	 * @var IXR_Error	 */	public $error; 	/**	 * @param string       $server	 * @param string|false $path	 * @param int|false    $port	 * @param int          $timeout	 */	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   = $bits['port'] ?? $port;			$this->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;	} 	/**	 * @since 3.1.0	 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it	 *              to the function signature.	 *	 * @return bool True if the request succeeded, false otherwise.	 */	public function query( ...$args ) {		$method  = array_shift( $args );		$request = new IXR_Request( $method, $args );		$xml     = $request->getXml(); 		$port = $this->port ? ":$this->port" : '';		$url  = $this->scheme . '://' . $this->server . $port . $this->path;		$args = array(			'headers'    => array( 'Content-Type' => 'text/xml' ),			'user-agent' => $this->useragent,			'body'       => $xml,		); 		// Merge Custom headers ala #8145.		foreach ( $this->headers as $header => $value ) {			$args['headers'][ $header ] = $value;		} 		/**		 * Filters the headers collection to be sent to the XML-RPC server.		 *		 * @since 4.4.0		 *		 * @param string[] $headers Associative array of headers to be sent.		 */		$args['headers'] = apply_filters( 'wp_http_ixr_client_headers', $args['headers'] ); 		if ( false !== $this->timeout ) {			$args['timeout'] = $this->timeout;		} 		// Now send the request.

Changelog

Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-http-ixr-client.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.