Automattic\WooCommerce\Internal\CLI\Migrator\Core
PlatformRegistry::get_platform_display_name
Gets the display name for a platform.
Method of the class: PlatformRegistry{}
No Hooks.
Returns
String. The proper display name (e.g., 'Shopify').
Usage
$PlatformRegistry = new PlatformRegistry(); $PlatformRegistry->get_platform_display_name( $platform_slug ): string;
- $platform_slug(string) (required)
- The platform identifier (e.g., 'shopify').
PlatformRegistry::get_platform_display_name() PlatformRegistry::get platform display name code WC 10.7.0
public function get_platform_display_name( string $platform_slug ): string {
$platform = $this->get_platform( $platform_slug );
if ( is_array( $platform ) && isset( $platform['name'] ) ) {
return $platform['name'];
}
// Fallback to ucfirst if platform not found or no name configured.
return ucfirst( $platform_slug );
}