wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_remote_retrieve_cookies › WordPress Function

Seit4.4.0
Veraltetn/v
wp_remote_retrieve_cookies ( $response )
Parameter:
  • (array|WP_Error) $response HTTP response.
    Erforderlich: Ja
Gibt zurück:
  • (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.
Definiert in:
Codex:

Retrieve only the cookies from the raw response.



Quellcode

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

	return $response['cookies'];
}