wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_remote_retrieve_headers › WordPress Function

Since2.7.0
Deprecatedn/a
wp_remote_retrieve_headers ( $response )
Parameters:
  • (array|WP_Error) $response HTTP response.
    Required: Yes
See:
  • WpOrgRequestsUtilityCaseInsensitiveDictionary
Returns:
  • (WpOrgRequestsUtilityCaseInsensitiveDictionary|array) The headers of the response, or empty array if incorrect parameter given.
Defined at:
Codex:
Change Log:
  • 4.6.0

Retrieves only the headers from the raw response.



Source

function wp_remote_retrieve_headers( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return array();
	}

	return $response['headers'];
}