instroducing WC_Session::delete

This commit is contained in:
Nicola Mustone 2015-08-11 10:11:36 +02:00
parent 4a24aeb5ee
commit 1017798c6c
1 changed files with 13 additions and 4 deletions

View File

@ -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.
*