wp_remote_retrieve_headers

函数


wp_remote_retrieve_headers ( $response )
参数
  • (array|WP_Error)
    $response
    HTTP response.
    Required:
返回值
  • (Requests_Utility_CaseInsensitiveDictionary|array) The headers of the response, or empty array if incorrect parameter given.
相关
  • Requests_Utility_CaseInsensitiveDictionary
定义位置
  • wp-includes/http.php
    , line 211
引入
2.7.0
弃用

Retrieve only the headers from the raw response.

function wp_remote_retrieve_headers( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return array();
	}

	return $response['headers'];
}