Retrieves only the response message from the raw response.
Description
Will return an empty string if incorrect parameter value is given.
Parameters
$response
array|WP_Errorrequired- HTTP response.
Source
function wp_remote_retrieve_response_message( $response ) {
if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {
return '';
}
return $response['response']['message'];
}
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
Make Request and Display Error