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

Retrieve HTTP Headers from URL.


Parameters Parameters

$url

(string) (Required) URL to retrieve HTTP headers from.

$deprecated

(bool) (Optional) Not Used.

Default value: false


Top ↑

Return Return

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


Top ↑

Source Source

File: wp-includes/functions.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
1.5.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.