Filter
rpress_count_payments_where
On this page
Filters the WHERE clause used by rpress_count_payments().
Runs after rpress_count_payments() has built the SQL WHERE clause from the search, user, customer, gateway, service type, order status, date and status arguments, and before the grouped count query runs against the posts table (aliased as p). Conditions you append can reference the postmeta joins added by the arguments and by the join filter. The query result is cached by a hash of the final SQL.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$where | string | The SQL WHERE clause, beginning with WHERE p.post_type = 'rpress_payment' in the default case. |
Return value#
string. The modified WHERE clause.
Example#
add_filter( 'rpress_count_payments_where', 'my_exclude_old_payments_from_counts', 10, 1 );
function my_exclude_old_payments_from_counts( $where ) {
return $where . " AND p.post_date >= '2025-01-01'";
}
Notes#
The final query is built by string concatenation, so values added by the callback must be escaped or prepared.
Source#
Applied in:
includes/payments/functions.php(line 716), inrpress_count_payments()
See also#
Was this page helpful?
