wp_get_http_headers( string $url, bool $deprecated = false )

Retrieve HTTP Headers from URL.


Parameters

$url

(Required) URL to retrieve HTTP headers from.

$deprecated

(Optional) Not Used.

Default value: false


Return

(bool|string) False on failure, headers on success.


Source

File: wp-includes/functions.php

function wp_get_http_headers( $url, $deprecated = false ) {
	if ( !empty( $deprecated ) )
		_deprecated_argument( __FUNCTION__, 'WP-2.7.0' );

	$response = wp_safe_remote_head( $url );

	if ( is_wp_error( $response ) )
		return false;

	return wp_remote_retrieve_headers( $response );
}


Changelog

Changelog
Version Description
WP-1.5.1 Introduced.