instroducing WC_Session::delete
This commit is contained in:
parent
4a24aeb5ee
commit
1017798c6c
|
@ -55,10 +55,7 @@ abstract class WC_Session {
|
|||
* @param mixed $key
|
||||
*/
|
||||
public function __unset( $key ) {
|
||||
if ( isset( $this->_data[ $key ] ) ) {
|
||||
unset( $this->_data[ $key ] );
|
||||
$this->_dirty = true;
|
||||
}
|
||||
$this->delete( $key );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,6 +83,18 @@ abstract class WC_Session {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a session variable
|
||||
*
|
||||
* @param string $key
|
||||
*/
|
||||
public function delete( $key ) {
|
||||
if ( isset( $this->_data[ $key ] ) ) {
|
||||
unset( $this->_data[ $key ] );
|
||||
$this->_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_customer_id function.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue