WordPress开发者和主题制作者的搜索引擎



wp_remote_retrieve_headers ›

Since2.7.0
已弃用n/a
wp_remote_retrieve_headers ( $response )
参数:
  • (array|WP_Error) $response HTTP response.
    Required: Yes
查看:
  • Requests_Utility_CaseInsensitiveDictionary
返回:
  • (array|Requests_Utility_CaseInsensitiveDictionary) The headers of the response. Empty array if incorrect parameter given.
定义在:
文档:
Change Log:
  • 4.6.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'];
}