wp_remote_head

函式
wp_remote_head ( $url, $args = array() )
引數
  • (string) $url URL to retrieve.
    Required:
  • (array) $args Optional. Request arguments. Default empty array.
    Required:
    Default: array()
返回值
  • (array|WP_Error) The response or WP_Error on failure.
相關
  • wp_remote_request()
  • WP_Http::request()
定義位置
相關方法
wp_safe_remote_headwp_remote_getwp_remote_fopenwp_remote_retrieve_headerwp_remote_request
引入
2.7.0
棄用
-

wp_remote_head: 該函式用於通過HTTP HEAD檢索遠端檔案的標頭檔案。它接受一個單一的引數:遠端檔案的URL。

使用HEAD方法執行一個HTTP請求並返回其響應。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_remote_head( $url, $args = array() ) {
$http = _wp_http_get_object();
return $http->head( $url, $args );
}
function wp_remote_head( $url, $args = array() ) { $http = _wp_http_get_object(); return $http->head( $url, $args ); }
function wp_remote_head( $url, $args = array() ) {
	$http = _wp_http_get_object();
	return $http->head( $url, $args );
}

常見問題

FAQs
檢視更多 >