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



wp_remote_retrieve_cookies ›

Since4.4.0
已弃用n/a
wp_remote_retrieve_cookies ( $response )
参数:
  • (array|WP_Error) $response HTTP response.
    Required: Yes
返回:
  • (WP_Http_Cookie[]) An array of `WP_Http_Cookie` objects from the response. Empty array if there are none, or the response is a WP_Error.
定义在:
文档:

Retrieve only the cookies from the raw response.



源码

function wp_remote_retrieve_cookies( $response ) {
	if ( is_wp_error( $response ) || empty( $response['cookies'] ) ) {
		return array();
	}

	return $response['cookies'];
}