(.*)?$#i', $fault_string, $match ) ) { $code = $match[1]; $message = $match[2]; $status = $fault_code; return new WP_Error( $code, $message, $status ); } return new WP_Error( "IXR_{$fault_code}", $fault_string ); } /** * Retrieve a response header if set. * * @param string $name header name. * @return string|bool Header value if set, false if not set. */ public function get_response_header( $name ) { if ( isset( $this->response_headers[ $name ] ) ) { return $this->response_headers[ $name ]; } // case-insensitive header names: http://www.ietf.org/rfc/rfc2616.txt. if ( isset( $this->response_headers[ strtolower( $name ) ] ) ) { return $this->response_headers[ strtolower( $name ) ]; } return false; } /** * Retrieve the raw response for the last query() call. * * @return null|array|WP_Error */ public function get_last_response() { return $this->last_response; } }