Filters

slimstat_get_var_sql

Applies to SlimStat 6.0.0 · checked

This filter receives the SQL for a single-value query and its aggregate expression. Return a valid SQL string. Never concatenate request input into it; prefer the database API and prepared parameters.

Callback signature

add_filter( 'slimstat_get_var_sql', function ( $sql, $aggregate ) {
    return $sql;
}, 10, 2 );

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