Requests_Cookie_Jar::offsetGet() WordPress Method

The Request_Cookie_Jar::offsetGet() method is used to get a cookie from a cookie jar by its name. If no cookie with the given name exists, NULL is returned.

Requests_Cookie_Jar::offsetGet( string $key ) #

Get the value for the item


Parameters

$key

(string)(Required)Item key


Top ↑

Return

(string|null) Item value (null if offsetExists is false)


Top ↑

Source

File: wp-includes/Requests/Cookie/Jar.php

	public function offsetGet($key) {
		if (!isset($this->cookies[$key])) {
			return null;
		}

		return $this->cookies[$key];
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.