WordPress filter hook
wc_session_expiring
Fired by 7 WordPress plugins, running on 7.1M+ sites between them.
“Filters the session expiration.”
How to use wc_session_expiring
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'wc_session_expiring', function( $default_expiring_seconds ) {
// Change $default_expiring_seconds here.
return $default_expiring_seconds;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
7 plugins that fire wc_session_expiring
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'wc_session_expiring', $default_expiring_seconds )includes/class-wc-session-handler.php:420 -
FOX50,000+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )classes/woocs_session.php:87 -
MStore API2,000+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )controllers/flutter-woo.php:1070 -
Bolt Checkout for WooCommerce100+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )includes/classes/class-bolt-auth-redirect.php:411 -
TABLEiT20+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )class-iwptp-session-handler.php:168 -
Knowband Mobile App Builder10+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )api/2.0/wmab-category.php:202 -
Rooster One10+ installs
apply_filters( 'wc_session_expiring', 60 * 60 * 47 )includes/carts/class-aieo-carts-frontend.php:524
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.