WP_HTTP_Response::set_data() WordPress Method
The WP_HTTP_Response::set_data() function is used to set the body data for an HTTP response. The data can be either a string or an array. If an array is passed, it will be serialized into a string before being set as the body data.
WP_HTTP_Response::set_data( mixed $data ) #
Sets the response data.
Parameters
- $data
(mixed)(Required)Response data.
Source
File: wp-includes/class-wp-http-response.php
public function set_data( $data ) {
$this->data = $data;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |