WC_Session::get()publicWC 1.0

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() code WC 8.7.0

public function get( $key, $default = null ) {
	$key = sanitize_key( $key );
	return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default;
}