On this page
WP_HTTP_Response::__construct( mixed $data = null, int $status = 200, array $headers = array() )
Constructor.
Parameters
$datamixed Optional-
Response data.
Default:
null $statusint Optional-
HTTP status code.
Default:
200 $headersarray Optional-
HTTP header map.
Default:
array()
Source
File: wp-includes/class-wp-http-response.php. View all references
public function __construct( $data = null, $status = 200, $headers = array() ) {
$this->set_data( $data );
$this->set_status( $status );
$this->set_headers( $headers );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_HTTP_Response::set_data() wp-includes/class-wp-http-response.php | Sets the response data. |
| WP_HTTP_Response::set_status() wp-includes/class-wp-http-response.php | Sets the 3-digit HTTP status code. |
| WP_HTTP_Response::set_headers() wp-includes/class-wp-http-response.php | Sets all header values. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_response/__construct