wp_remote_retrieve_header( array|WP_Error $response, string $header )
Retrieve a single header by name from the raw response.
Description Description
Parameters Parameters
- $response
-
(array|WP_Error) (Required) HTTP response.
- $header
-
(string) (Required) Header name to retrieve value from.
Return Return
(string) The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
Source Source
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 ''; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Get last modified date from response header