WC_Session_Handler::init()
Init hooks and session data.
Method of the class: WC_Session_Handler{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Session_Handler = new WC_Session_Handler(); $WC_Session_Handler->init();
Changelog
Since 3.3.0 | Introduced. |
WC_Session_Handler::init() WC Session Handler::init code WC 9.6.1
public function init() { $this->init_session_cookie(); add_action( 'woocommerce_set_cart_cookies', array( $this, 'set_customer_session_cookie' ), 10 ); add_action( 'wp', array( $this, 'maybe_set_customer_session_cookie' ), 99 ); add_action( 'shutdown', array( $this, 'save_data' ), 20 ); add_action( 'wp_logout', array( $this, 'destroy_session' ) ); if ( ! is_user_logged_in() ) { add_filter( 'nonce_user_logged_out', array( $this, 'maybe_update_nonce_user_logged_out' ), 10, 2 ); } }