HTTP/2 301
server: nginx
date: Thu, 17 Jul 2025 00:27:19 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/wp_remote_retrieve_header/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Thu, 17 Jul 2025 00:27:19 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
wp_remote_retrieve_header() – Function | Developer.WordPress.org
wp_remote_retrieve_header( array|WP_Error $response , string $header ): array|string
Retrieves a single header by name from the raw response.
$response
array |WP_Error required HTTP response.
$header
string required Header name to retrieve value from.
array|string The header(s) value(s). Array if multiple headers with the same name are retrieved.
Empty string if incorrect parameter given, or if the header doesn’t exist.
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 '';
}
View all references View on Trac View on GitHub
Version Description 2.7.0 Introduced.
Get last modified date from response header