diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-includes/class-wp-http-ixr-client.php --- a/wp/wp-includes/class-wp-http-ixr-client.php Tue Jun 09 11:14:17 2015 +0000 +++ b/wp/wp-includes/class-wp-http-ixr-client.php Mon Oct 14 17:39:30 2019 +0200 @@ -46,6 +46,9 @@ $this->timeout = $timeout; } + /** + * @return bool + */ public function query() { $args = func_get_args(); $method = array_shift($args); @@ -61,15 +64,27 @@ ); // Merge Custom headers ala #8145 - foreach ( $this->headers as $header => $value ) + foreach ( $this->headers as $header => $value ) { $args['headers'][$header] = $value; + } - if ( $this->timeout !== false ) + /** + * Filters the headers collection to be sent to the XML-RPC server. + * + * @since 4.4.0 + * + * @param array $headers Array of headers to be sent. + */ + $args['headers'] = apply_filters( 'wp_http_ixr_client_headers', $args['headers'] ); + + if ( $this->timeout !== false ) { $args['timeout'] = $this->timeout; + } // Now send the request - if ( $this->debug ) + if ( $this->debug ) { echo '
' . htmlspecialchars($xml) . "\n
\n\n"; + } $response = wp_remote_post($url, $args); @@ -85,8 +100,9 @@ return false; } - if ( $this->debug ) + if ( $this->debug ) { echo '
' . htmlspecialchars( wp_remote_retrieve_body( $response ) ) . "\n
\n\n"; + } // Now parse what we've got back $this->message = new IXR_Message( wp_remote_retrieve_body( $response ) );