On this page
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
$responsearray|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'];
}
Related
Uses
| Uses | Description |
|---|---|
| is_wp_error() wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
Used By
| Used By | Description |
|---|---|
| WP_Site_Health::check_for_page_caching() wp-admin/includes/class-wp-site-health.php | Checks if site has page cache enabled or not. |
| wp_update_https_detection_errors() wp-includes/https-detection.php | Runs a remote HTTPS request to detect whether HTTPS supported, and stores potential errors. |
| WP_Site_Health::get_test_rest_availability() wp-admin/includes/class-wp-site-health.php | Tests if the REST API is accessible. |
| download_url() wp-admin/includes/file.php | Downloads a URL to a local temporary file using the WordPress HTTP API. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_remote_retrieve_response_message