Skip to content
Docs
Get RestroPress

Filter

rpress_recount_fooditem_stats_total_args

Updated
On this page

Filters the arguments used to count sale logs when calculating recount progress.

Runs the first time the progress percentage is computed for a menu item stats recalculation. The array is passed to get_connected_logs() to fetch every sale log ID without paging, so the total drives the progress bar. Keep it consistent with rpress_recount_fooditem_stats_args or the progress will be off.

Parameters#

ParameterTypeDescription
$argsarrayQuery arguments for the total sale log lookup, with nopaging enabled.

Return value#

array. The modified query arguments.

Example#

function my_recount_fooditem_stats_total_args( $args ) {
	$args['date_query'] = array(
		array( 'after' => '2024-01-01' ),
	);
	return $args;
}
add_filter( 'rpress_recount_fooditem_stats_total_args', 'my_recount_fooditem_stats_total_args' );

Notes#

Fired from RPRESS_Tools_Recount_All_Stats (with post_parent__in) and RPRESS_Tools_Recount_Download_Stats (with post_parent).

Source#

Applied in:

  • includes/admin/tools/class-rpress-tools-recount-all-stats.php (line 256), in RPRESS_Tools_Recount_All_Stats::pre_fetch()
  • includes/admin/tools/class-rpress-tools-recount-download-stats.php (line 149), in RPRESS_Tools_Recount_Download_Stats::get_percentage_complete()

See also#

Was this page helpful?