Skip to main content

GravityKit\GravityMigrate\Platforms\PlatformIcons

Resolves a platform's icon to a URL the browser can load.

The marks ship with this plugin rather than being read out of the other plugin's install: only three of the seven ship a square mark at a stable path, so resolving at runtime would leave half the list on the fallback glyph. Six are the mark from the plugin's own WordPress.org listing.

WS Form has no directory listing, so its mark comes from the plugin itself: includes/third-party/divi/.../ws-form/icon.svg, the square monogram it gives Divi's module picker. Its viewBox is cropped to the artwork (6 6 16 16 of a 28x28 canvas) because that file is padded for a builder's own tile, and the padding renders WS Form a size smaller than every mark beside it.

Source: src/Platforms/PlatformIcons.php:23

Details

  • Kind: class
  • Namespace: GravityKit\GravityMigrate\Platforms

Methods

MethodDescription
url_for()The URL of a platform's mark, or an empty string when it has none.

Method Reference

url_for()

public static function url_for( string $slug ): string

The URL of a platform's mark, or an empty string when it has none.

The file is named for the platform slug, so the filename is the whole mapping.

Parameters

NameTypeDefaultDescription
$slugstringPlatform slug, as the importer or exporter reports it.

Returns

  • string — Absolute URL, or '' when nothing is shipped for this platform.

Since: %ver%

Source: src/Platforms/PlatformIcons.php:57