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



wp_get_http_headers › WordPress Function

Since1.5.1
Deprecatedn/a
wp_get_http_headers ( $url, $deprecated = false )
Parameters: (2)
  • (string) $url URL to retrieve HTTP headers from.
    Required: Yes
  • (bool) $deprecated Not Used.
    Required: No
    Default: false
Returns:
  • (WpOrgRequestsUtilityCaseInsensitiveDictionary|false) Headers on success, false on failure.
Defined at:
Codex:

Retrieves HTTP Headers from URL.



Source

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

	$response = wp_safe_remote_head( $url );

	if ( is_wp_error( $response ) ) {
		return false;
	}

	return wp_remote_retrieve_headers( $response );
}