WP_HTTP_Requests_Response::set_data() WordPress Method
The WP_HTTP_Requests_Response::set_data() method is used to set the body data for a HTTP response. The data can be either a string or an array.
WP_HTTP_Requests_Response::set_data( string $data ) #
Sets the response data.
Contents
Parameters
- $data
(string)(Required)Response data.
Source
File: wp-includes/class-wp-http-requests-response.php
public function set_data( $data ) {
$this->response->body = $data;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |