wp_remote_retrieve_header

Definition:
function wp_remote_retrieve_header(&$response, $header) {}

Retrieve a single header by name from the raw response.

Parameters

  • array $response
  • string $header: Header name to retrieve value from.
  • &$response

Return values

returns:The header value. Empty string on if incorrect parameter given, or if the header doesn’t exist.

Source code

function wp_remote_retrieve_header(&$response, $header) {

	if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers']))

		return '';



	if ( array_key_exists($header, $response['headers']) )

		return $response['headers'][$header];



	return '';

}

4045

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: