wc_migrator_batch_processed хук-событиеWC 10.3.0

Fires when a batch has been processed during migration.

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

add_action( 'wc_migrator_batch_processed', 'wp_kama_wc_migrator_batch_processed_action', 10, 3 );

/**
 * Function for `wc_migrator_batch_processed` action-hook.
 * 
 * @param array $batch_results   Results from the batch import.
 * @param array $source_data     Source platform data for the batch.
 * @param array $mapped_products Mapped WooCommerce data for the batch.
 *
 * @return void
 */
function wp_kama_wc_migrator_batch_processed_action( $batch_results, $source_data, $mapped_products ){

	// action...
}
$batch_results(массив)
Results from the batch import.
$source_data(массив)
Source platform data for the batch.
$mapped_products(массив)
Mapped WooCommerce data for the batch.

Список изменений

С версии 10.3.0 Введена.

Где вызывается хук

ProductsController::process_batch()
wc_migrator_batch_processed
woocommerce/src/Internal/CLI/Migrator/Core/ProductsController.php 705
do_action( 'wc_migrator_batch_processed', $batch_results, $source_data_batch, $mapped_products );

Где используется хук в WooCommerce

woocommerce/src/Internal/CLI/Migrator/Core/MigratorTracker.php 48
add_action( 'wc_migrator_batch_processed', array( $this, 'on_batch_processed' ), 10, 3 );