Retrieves a single header by name from the raw response.
Parameters
$response
array|WP_Errorrequired- HTTP response.
$header
stringrequired- Header name to retrieve value from.
Source
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 '';
}
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
Get last modified date from response header