wc_migrator_batch_processed action-hookWC 10.3.0

Fires when a batch has been processed during migration.

Usage

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(array)
Results from the batch import.
$source_data(array)
Source platform data for the batch.
$mapped_products(array)
Mapped WooCommerce data for the batch.

Changelog

Since 10.3.0 Introduced.

Where the hook is called

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

Where the hook is used in WooCommerce

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