Tribe__Tickets_Plus__Commerce__WooCommerce__Meta::get_hash_cookie( null|string $hash, null|int $post_id )
Get hash value from WooCommerce session.
Contents
Parameters
- $hash
-
(null|string) (Required) The hash value.
- $post_id
-
(null|int) (Required) Post ID (or null if using current post).
Return
(null|string) The hash value.
Source
File: src/Tribe/Commerce/WooCommerce/Meta.php
public function get_hash_cookie( $hash, $post_id ) {
if ( ! empty( $hash ) || ! is_admin() || 'product' !== get_post_type( $post_id ) ) {
return $hash;
}
$wc_session = WC()->session;
if ( empty( $wc_session ) ) {
return $hash;
}
$hash = $wc_session->get( Tribe__Tickets_Plus__Meta__Storage::HASH_COOKIE_KEY );
return $hash;
}
Changelog
| Version | Description |
|---|---|
| 4.11.0 | Introduced. |