Skip to content
Docs
Get RestroPress

Filter

rpress_tools_reset_stats_total_args

Updated
On this page

Filters the query arguments used to collect posts for a data reset.

Runs right after rpress_reset_store_post_types. The array is passed to get_posts() and by default has post_type, post_status set to any and posts_per_page set to -1. Each returned post is added to the reset list with its ID and post type.

Parameters#

ParameterTypeDescription
$argsarrayArguments for get_posts: post_type, post_status and posts_per_page.

Return value#

array. The modified get_posts arguments.

Example#

function my_reset_stats_total_args( $args ) {
	$args['date_query'] = array(
		array( 'before' => '2024-01-01' ),
	);
	return $args;
}
add_filter( 'rpress_tools_reset_stats_total_args', 'my_reset_stats_total_args' );

Notes#

This tool deletes data. Test any change on a staging site.

Source#

Applied in:

  • includes/admin/tools/class-rpress-tools-reset-stats.php (line 233), in RPRESS_Tools_Reset_Stats::pre_fetch()

See also#

Was this page helpful?