WC_Session_Handler::init_hooksprotectedWC 1.0

Initialize the hooks.

Method of the class: WC_Session_Handler{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->init_hooks();

WC_Session_Handler::init_hooks() code WC 10.3.3

protected function init_hooks() {
	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( 'template_redirect', array( $this, 'destroy_session_if_empty' ), 999 );
	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 );
	}
}