Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_get_http_headers ›

Da1.5.1
Deprecaton/a
wp_get_http_headers ( $url, $deprecated = false )
Parametri: (2)
  • (string) $url URL to retrieve HTTP headers from.
    Richiesto:
  • (bool) $deprecated Not Used.
    Richiesto: No
    Default: false
Ritorna:
  • (bool|string) False on failure, headers on success.
Definito a:
Codex:

Retrieve HTTP Headers from URL.



Sorgenti

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 );
}