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



wp_remote_retrieve_cookie_value › WordPress Function

Seit4.4.0
Veraltetn/v
wp_remote_retrieve_cookie_value ( $response, $name )
Parameter: (2)
  • (array|WP_Error) $response HTTP response.
    Erforderlich: Ja
  • (string) $name The name of the cookie to retrieve.
    Erforderlich: Ja
Gibt zurück:
  • (string) The value of the cookie, or empty string if the cookie is not present in the response.
Definiert in:
Codex:

Retrieve a single cookie's value by name from the raw response.



Quellcode

function wp_remote_retrieve_cookie_value( $response, $name ) {
	$cookie = wp_remote_retrieve_cookie( $response, $name );

	if ( ! ( $cookie instanceof WP_Http_Cookie ) ) {
		return '';
	}

	return $cookie->value;
}