From 1017798c6cca68c6207aac6adef699f5b941131c Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Tue, 11 Aug 2015 10:11:36 +0200 Subject: [PATCH] instroducing WC_Session::delete --- includes/abstracts/abstract-wc-session.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/includes/abstracts/abstract-wc-session.php b/includes/abstracts/abstract-wc-session.php index 2817f45d069..252583f5796 100644 --- a/includes/abstracts/abstract-wc-session.php +++ b/includes/abstracts/abstract-wc-session.php @@ -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. *