Filter
rpress_recount_fooditem_stats_args
On this page
Filters the arguments used to query sale logs when recounting menu item stats.
Runs once per batch step while stats are recalculated. The array is passed to get_connected_logs() on the logging class to fetch sale log entries; it includes post_type, post_status, paged, posts_per_page, log_type and fields. The parent key differs by tool: post_parent__in for the all-menu-items recalculation and post_parent for a single menu item.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$args | array | Query arguments for the sale log lookup. |
Return value#
array. The modified query arguments.
Example#
function my_recount_fooditem_stats_args( $args ) {
$args['date_query'] = array(
array( 'after' => '2024-01-01' ),
);
return $args;
}
add_filter( 'rpress_recount_fooditem_stats_args', 'my_recount_fooditem_stats_args' );
Notes#
Fired from RPRESS_Tools_Recount_All_Stats (with post_parent__in) and RPRESS_Tools_Recount_Download_Stats (with post_parent). Argument keys differ between the two.
Source#
Applied in:
includes/admin/tools/class-rpress-tools-recount-all-stats.php(line 63), inRPRESS_Tools_Recount_All_Stats::get_data()includes/admin/tools/class-rpress-tools-recount-download-stats.php(line 61), inRPRESS_Tools_Recount_Download_Stats::get_data()
See also#
Was this page helpful?
