Filters the session data when restoring from storage during initialization. This filter allows you to: 1. Modify the session data before it's loaded, including adding or removing specific session data entries 2. Clear the entire session by returning an empty array Note: If the filtered data is empty, the session will be destroyed and the guest's session cookie will be removed. This can be useful for high-traffic sites that prioritize page caching over maintaining all session data.
$session_data
Sortie :
@param array $session_data The session data loaded from storage. @return array Modified session data to be used for initialization.
// Modifier la valeur avec le filtre 'woocommerce_restored_session_data'
add_filter('woocommerce_restored_session_data', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($session_data) {
// Modifier la valeur
return $session_data;
}
Chargement des actualités...