Filter
rpress_stats_earnings_args
On this page
Filters the query arguments used to calculate earnings in RPRESS_Payment_Stats::get_earnings.
The array is passed to get_posts to find the payment IDs to sum, and is also hashed to build the cache key for the transient result. It contains post_type, post_status, nopaging and other WP_Query keys, plus start_date, end_date, rpress_transient_type and include_taxes used only for caching. Changing the arguments changes both the result and its cache key.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$args | array | get_posts arguments for the payments query. |
Return value#
array. The arguments to use.
Example#
function my_earnings_args( $args ) {
$args['post_status'] = array( 'publish' );
return $args;
}
add_filter( 'rpress_stats_earnings_args', 'my_earnings_args' );
Notes#
Applied in two places in get_earnings with the same signature. Results are cached in the rpress_stats_earnings transient.
Source#
Applied in:
includes/payments/class-payment-stats.php(line 109), inRPRESS_Payment_Stats::get_earnings()includes/payments/class-payment-stats.php(line 159), inRPRESS_Payment_Stats::get_earnings()
See also#
Was this page helpful?
