wc_migrator_session_started
Fires when a migration session starts.
Использование
add_action( 'wc_migrator_session_started', 'wp_kama_wc_migrator_session_started_action', 10, 2 );
/**
* Function for `wc_migrator_session_started` action-hook.
*
* @param string $platform The platform being migrated from.
* @param array $metadata Session metadata including session_id, filters, and fields.
*
* @return void
*/
function wp_kama_wc_migrator_session_started_action( $platform, $metadata ){
// action...
}
- $platform(строка)
- The platform being migrated from.
- $metadata(массив)
- Session metadata including session_id, filters, and fields.
Список изменений
| С версии 10.3.0 | Введена. |
Где вызывается хук
wc_migrator_session_started
woocommerce/src/Internal/CLI/Migrator/Core/ProductsController.php 147-157
do_action( 'wc_migrator_session_started', $this->parsed_args['platform'], array( 'session_id' => $this->session->get_id(), 'filters' => $this->parsed_args['filters'], 'fields' => $this->fields_to_process, 'is_dry_run' => $this->parsed_args['dry_run'], 'resume' => $this->parsed_args['resume'], ) );
Где используется хук в WooCommerce
woocommerce/src/Internal/CLI/Migrator/Core/MigratorTracker.php 47
add_action( 'wc_migrator_session_started', array( $this, 'on_session_started' ), 10, 2 );