wp_remote_retrieve_response_message( array|WP_Error $response ): string
Retrieve only the response message from the raw response.
Description
Will return an empty string if incorrect parameter value is given.
Parameters
-
$response
array|WP_Error Required -
HTTP response.
Return
string The response message. Empty string if incorrect parameter given.
Source
File: wp-includes/http.php
.
View all references
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. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Make Request and Display Error