W3cubDocs

/WordPress

WP_HTTP_Response::__construct( mixed $data = null, int $status = 200, array $headers = array() )

Constructor.

Parameters

$datamixedoptional
Response data.

Default:null

$statusintoptional
HTTP status code.

Default:200

$headersarrayoptional
HTTP header map.

Default:array()

Source

public function __construct( $data = null, $status = 200, $headers = array() ) {
	$this->set_data( $data );
	$this->set_status( $status );
	$this->set_headers( $headers );
}

Changelog

Version Description
4.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_response/__construct