Merge pull request #8768 from SiR-DanieL/session-delete

Instroducing WC_Session::delete
This commit is contained in:
Mike Jolley 2015-09-16 10:34:51 +01:00
commit f63c500848
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->unset( $key );
}
/**
@ -86,6 +83,18 @@ abstract class WC_Session {
}
}
/**
* Delete a session variable
*
* @param string $key
*/
public function unset( $key ) {
if ( isset( $this->_data[ $key ] ) ) {
unset( $this->_data[ $key ] );
$this->_dirty = true;
}
}
/**
* get_customer_id function.
*