WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin

ReportsSync::reset_import_stats() public WC 1.0

Update the import stat totals and counts.

{} Это метод класса: ReportsSync{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$result = ReportsSync::reset_import_stats( $days, $skip_existing );
$days(число/true/false) (обязательный)
Number of days to import.
$skip_existing(true/false) (обязательный)
Skip exisiting records.

Код ReportsSync::reset_import_stats() WC 4.7.1

<?php
public static function reset_import_stats( $days, $skip_existing ) {
	$import_stats = get_option( ImportScheduler::IMPORT_STATS_OPTION, array() );
	$totals       = self::get_import_totals( $days, $skip_existing );

	foreach ( self::get_schedulers() as $scheduler ) {
		$import_stats[ $scheduler::$name ]['imported'] = 0;
		$import_stats[ $scheduler::$name ]['total']    = $totals[ $scheduler::$name ];
	}

	// Update imported from date if older than previous.
	$previous_import_date = isset( $import_stats['imported_from'] ) ? $import_stats['imported_from'] : null;
	$current_import_date  = $days ? gmdate( 'Y-m-d 00:00:00', time() - ( DAY_IN_SECONDS * $days ) ) : -1;

	if ( ! $previous_import_date || -1 === $current_import_date || new \DateTime( $previous_import_date ) > new \DateTime( $current_import_date ) ) {
		$import_stats['imported_from'] = $current_import_date;
	}

	update_option( ImportScheduler::IMPORT_STATS_OPTION, $import_stats );
}