Uses
| Uses | Description |
|---|---|
| wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Retrieve a single header by name from the raw response.
(array|WP_Error) (Required) HTTP response.
(string) (Required) Header name to retrieve value from.
(string) The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
File: wp-includes/http.php
function wp_remote_retrieve_header( $response, $header ) {
if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
return '';
}
if ( isset( $response['headers'][ $header ] ) ) {
return $response['headers'][ $header ];
}
return '';
} | Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_remote_retrieve_header