wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_remote_retrieve_cookie_value › WordPress Function

Da4.4.0
Deprecaton/a
› wp_remote_retrieve_cookie_value ( $response, $name )
Parametri: (2)
  • (array|WP_Error) $response HTTP response.
    Richiesto: Sì
  • (string) $name The name of the cookie to retrieve.
    Richiesto: Sì
Ritorna:
  • (string) The value of the cookie, or empty string
    if the cookie is not present in the response.
Definito a:
Codex:

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



Sorgenti

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 ?? '';
}