WC_Session::get()
Get a session variable.
Method of the class: WC_Session{}
No Hooks.
Return
Array|String
. value of session variable
Usage
$WC_Session = new WC_Session(); $WC_Session->get( $key, $default );
- $key(string) (required)
- Key to get.
- $default(mixed)
- used if the session variable isn't set.
Default: null
WC_Session::get() WC Session::get code WC 9.7.1
public function get( $key, $default = null ) { $key = sanitize_key( $key ); return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default; }