wc_session_expiration
Filters the session expiration.
Использование
add_filter( 'wc_session_expiration', 'wp_kama_wc_session_expiration_filter' ); /** * Function for `wc_session_expiration` filter-hook. * * @param int $expiration Expiration in seconds. * * @return int */ function wp_kama_wc_session_expiration_filter( $expiration ){ // filter... return $expiration; }
- $expiration(int)
- Expiration in seconds.
Список изменений
С версии 8.7.0 | Введена. |
Где вызывается хук
wc_session_expiration
wc_session_expiration
woocommerce/src/StoreApi/Routes/V1/AbstractCartRoute.php 222
return time() + intval( apply_filters( 'wc_session_expiration', DAY_IN_SECONDS * 2 ) );
woocommerce/includes/class-wc-session-handler.php 221
$this->_session_expiration = time() + intval( apply_filters( 'wc_session_expiration', 60 * 60 * 48 ) ); // 48 Hours.