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



wp_remote_retrieve_headers › WordPress Function

Since2.7.0
已弃用n/a
wp_remote_retrieve_headers ( $response )
参数:
  • (array|WP_Error) $response HTTP response.
    Required: Yes
查看:
  • WpOrgRequestsUtilityCaseInsensitiveDictionary
返回:
  • (WpOrgRequestsUtilityCaseInsensitiveDictionary|array) The headers of the response, or 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'];
}