A WordPress-centric search engine for devs and theme authors



wp_get_http_headers ›

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:
  • (bool|string) False on failure, headers on success.
Defined at:
Codex:

Retrieve HTTP Headers from URL.



Source

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

	$response = wp_safe_remote_head( $url );

	if ( is_wp_error( $response ) )
		return false;

	return wp_remote_retrieve_headers( $response );
}