Filters

slimstat_get_results_sql

Applies to SlimStat 6.0.0 · checked

This filter receives a completed report SQL string plus the select, order, group and aggregate arguments. It is a low-level integration point. Appending AND ... to an already completed query can produce invalid SQL after ORDER BY or LIMIT. Prefer report filters or the database API.

Callback signature

add_filter( 'slimstat_get_results_sql', function ( $sql, $select, $order, $group, $aggregate ) {
    return $sql;
}, 10, 5 );

Test callbacks on staging with your tracking mode and report context. See the database API and building an add-on.