Filter
rpress_get_total_earnings_args
On this page
Filters the payment query arguments used to calculate total earnings.
Runs in rpress_get_total_earnings() only when no total is stored in the rpress_earnings_total option and no transient exists, so it affects the fallback calculation. The default query selects all payments with the publish or revoked status and returns only IDs. The result is passed to rpress_get_payments().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$args | array | Defaults: 'offset' => 0, 'number' => -1, 'status' => array( 'publish', 'revoked' ), 'fields' => 'ids'. |
Return value#
array. Arguments for rpress_get_payments().
Example#
add_filter( 'rpress_get_total_earnings_args', 'my_earnings_only_published', 10, 1 );
function my_earnings_only_published( $args ) {
$args['status'] = array( 'publish' );
return $args;
}
Notes#
Has no effect once the stored earnings total exists.
Source#
Applied in:
includes/payments/functions.php(line 1127), inrpress_get_total_earnings()
See also#
Was this page helpful?
