woocommerce_migrator_platforms
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.
Usage
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(array)
- 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.
Changelog
| Since 1.0.0 | Introduced. |
Where the hook is called
woocommerce_migrator_platforms
woocommerce/src/Internal/CLI/Migrator/Core/PlatformRegistry.php 66
$platforms = apply_filters( 'woocommerce_migrator_platforms', array() );
Where the hook is used in WooCommerce
woocommerce/src/Internal/CLI/Migrator/Platforms/Shopify/ShopifyPlatform.php 28
add_filter( 'woocommerce_migrator_platforms', array( self::class, 'register_platform' ) );