WooCommerce::initialize_session()
Initialize the session class.
Method of the class: WooCommerce{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->initialize_session();
Changelog
Since 3.6.4 | Introduced. |
WooCommerce::initialize_session() WooCommerce::initialize session code WC 9.2.3
public function initialize_session() { /** * Filter to overwrite the session class that handles session data for users. */ $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment if ( is_null( $this->session ) || ! $this->session instanceof $session_class ) { $this->session = new $session_class(); $this->session->init(); } }