Automattic\WooCommerce\Internal\StockNotifications\Frontend

NotificationManagementService::ensure_notice_session │ private │ WC 1.0

Ensure there is a cookie-based session so frontend notices survive the redirect.

Метод класса: NotificationManagementService{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->ensure_notice_session(): void;

Код NotificationManagementService::ensure_notice_session() WC 11.2.2

private function ensure_notice_session(): void {
	if ( WC()->session instanceof \WC_Session_Handler && ! WC()->session->has_session() ) {
		WC()->session->set_customer_session_cookie( true );
	}
}