woocommerce_migrator_platforms │ хук-фильтр │ WC 1.0.0

Filters the list of registered migration platforms.

External platform plugins should hook into this filter to register themselves. Each platform plugin is responsible for its own autoloading and initialization.

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

add_filter( 'woocommerce_migrator_platforms', 'wp_kama_woocommerce_migrator_platforms_filter' );

/**
 * Function for `woocommerce_migrator_platforms` filter-hook.
 * 
 * @param array $platforms An associative array of platform configurations. Each key is a unique
 *                         platform ID (e.g., 'shopify'), and the value is another array containing
 *                         'name', 'fetcher', and 'mapper' class names.
 *
 * @return array
 */
function wp_kama_woocommerce_migrator_platforms_filter( $platforms ){
	// filter...
	return $platforms;
}
$platforms(массив)
An associative array of platform configurations. Each key is a unique platform ID (e.g., 'shopify'), and the value is another array containing 'name', 'fetcher', and 'mapper' class names.

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

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

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

PlatformRegistry::load_platforms()
woocommerce_migrator_platforms
woocommerce/src/Internal/CLI/Migrator/Core/PlatformRegistry.php 66
$platforms = apply_filters( 'woocommerce_migrator_platforms', array() );

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

woocommerce/src/Internal/CLI/Migrator/Platforms/Shopify/ShopifyPlatform.php 28
add_filter( 'woocommerce_migrator_platforms', array( self::class, 'register_platform' ) );
woocommerce/src/Internal/CLI/Migrator/Platforms/Webflow/WebflowPlatform.php 30
add_filter( 'woocommerce_migrator_platforms', array( self::class, 'register_platform' ) );