WordPress filter hook
wp_session_count_query
Fired by 8 WordPress plugins, running on 44K+ sites between them.
“Filter the query in case tables are non-standard.”
How to use wp_session_count_query
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( 'wp_session_count_query', function( $query ) {
// Change $query here.
return $query;
}, 10, 1 );Argument names come from WP Travel Engine's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
8 plugins that fire wp_session_count_query
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WP Travel Engine20,000+ installs
apply_filters( 'wp_session_count_query', $query )includes/classes/Utilities/SessionUtils.php:27 -
Charitable10,000+ installs
apply_filters( 'wp_session_count_query', $query )includes/libraries/wp-session/class-wp-session-utils.php:26 -
eCommerce Product Catalog7,000+ installs
apply_filters( 'wp_session_count_query', $query )ext-comp/wp_session/class-wp-session-utils.php:33 -
WP Delicious4,000+ installs
apply_filters( 'wp_session_count_query', $query )src/lib/wp-session/class-wp-session-utils.php:25 -
Restaurant Menu and Food Ordering2,000+ installs
apply_filters( 'wp_session_count_query', $query )classes/libs/wp_session/class-wp-session-utils.php:28 -
Product Catalog Simple1,000+ installs
apply_filters( 'wp_session_count_query', $query )core/ext-comp/wp_session/class-wp-session-utils.php:33 -
Widget Master10+ installs
apply_filters( 'wp_session_count_query', $query )includes/includes/class-wp-session-utils.php:26 -
Post and Page Protect with Azure ADFewer than 10 installs
apply_filters( 'wp_session_count_query', $query )vendors/wp-session-manager/includes/class-wp-session-utils.php:30
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.