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


ImportScheduler::import_batch() public WC 1.0

Imports a batch of items to update.

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

Хуков нет.




$result = ImportScheduler::import_batch( $batch_number, $days, $skip_existing );
$batch_number(число) (обязательный)
Batch number to import (essentially a query page number).
$days(число/true/false) (обязательный)
Number of days to import.
$skip_existing(true/false) (обязательный)
Skip exisiting records.

Код ImportScheduler::import_batch() WC 4.7.1

public static function import_batch( $batch_number, $days, $skip_existing ) {
	$batch_size = static::get_batch_size( 'import' );

	$properties = array(
		'batch_number' => $batch_number,
		'batch_size'   => $batch_size,
		'type'         => static::$name,
	wc_admin_record_tracks_event( 'import_job_start', $properties );

	// When we are skipping already imported items, the table of items to import gets smaller in
	// every batch, so we want to always import the first page.
	$page  = $skip_existing ? 1 : $batch_number;
	$items = static::get_items( $batch_size, $page, $days, $skip_existing );

	foreach ( $items->ids as $id ) {
		static::import( $id );

	$import_stats                              = get_option( self::IMPORT_STATS_OPTION, array() );
	$imported_count                            = absint( $import_stats[ static::$name ]['imported'] ) + count( $items->ids );
	$import_stats[ static::$name ]['imported'] = $imported_count;
	update_option( self::IMPORT_STATS_OPTION, $import_stats );

	$properties['imported_count'] = $imported_count;

	wc_admin_record_tracks_event( 'import_job_complete', $properties );