WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / class-wp-http-cookie.php
index 95148efd53b167b6956230c824d9722eb7822272..d2affc2cc1b49805d4b9c05f72a9d4a37fd356ba 100644 (file)
@@ -195,7 +195,7 @@ class WP_Http_Cookie {
                        return '';
 
                /**
-                * Filter the header-encoded cookie value.
+                * Filters the header-encoded cookie value.
                 *
                 * @since 3.4.0
                 *
@@ -216,4 +216,26 @@ class WP_Http_Cookie {
        public function getFullHeader() {
                return 'Cookie: ' . $this->getHeaderValue();
        }
+
+       /**
+        * Retrieves cookie attributes.
+        *
+        * @since 4.6.0
+        * @access public
+        *
+        * @return array {
+        *    List of attributes.
+        *
+        *    @type string $expires When the cookie expires.
+        *    @type string $path    Cookie URL path.
+        *    @type string $domain  Cookie domain.
+        * }
+        */
+       public function get_attributes() {
+               return array(
+                       'expires' => $this->expires,
+                       'path'    => $this->path,
+                       'domain'  => $this->domain,
+               );
+       }
 }