Skip to main content

GravityKit\GravityMigrate\Importers\ImporterInterface

Describes the methods required for all external form importers.

Since: %ver%

Source: src/Importers/ImporterInterface.php:17

Details​

  • Kind: interface
  • Namespace: GravityKit\GravityMigrate\Importers

Methods​

MethodDescription
get_slug()Returns the unique slug used to reference the importer.
get_name()Returns the human-readable importer name.
get_description()Returns a short description of the importer.
is_available()Whether the importer can run on the current site (dependencies active, etc).
missing_requirements()Which of this platform's requirements are not installed here.
list_forms()Returns a list of importable forms.
analyze_form()Reports what the requested form loses on the way to Gravity Forms.
import_form()Creates the Gravity Forms form for the requested source form.
translate_smart_tags()Converts provider-specific smart tags or merge tags into Gravity Forms

Method Reference​

get_slug()​

public function get_slug(): string

Returns the unique slug used to reference the importer.

Returns​

  • string

Since: %ver%

Source: src/Importers/ImporterInterface.php:26

get_name()​

public function get_name(): string

Returns the human-readable importer name.

Returns​

  • string

Since: %ver%

Source: src/Importers/ImporterInterface.php:35

get_description()​

public function get_description(): string

Returns a short description of the importer.

Returns​

  • string

Since: %ver%

Source: src/Importers/ImporterInterface.php:44

is_available()​

public function is_available(): bool

Whether the importer can run on the current site (dependencies active, etc).

Returns​

  • bool

Since: %ver%

Source: src/Importers/ImporterInterface.php:53

missing_requirements()​

public function missing_requirements(): array

Which of this platform's requirements are not installed here.

The reason behind \self::is_available(): an empty list is what makes it true, and the names are what tells an operator which plugin to activate.

Returns​

  • string[] — Class, interface or function names that resolve to nothing on this site.

Since: %ver%

Source: src/Importers/ImporterInterface.php:65

list_forms()​

public function list_forms( array $args=[] ): array

Returns a list of importable forms.

Parameters​

NameTypeDefaultDescription
$argsarray[]Optional request arguments.

Returns​

  • array — Associative arrays carrying at least id and title.

Since: %ver%

Source: src/Importers/ImporterInterface.php:76

analyze_form()​

public function analyze_form( $form_id, array $args=[] )

Reports what the requested form loses on the way to Gravity Forms.

Parameters​

NameTypeDefaultDescription
$form_idmixedSource form identifier.
$argsarray[]Optional request arguments.

Returns​

  • array | WP_Error — Field notices and warnings, or WP_Error when the form cannot be read.

Since: %ver%

Source: src/Importers/ImporterInterface.php:88

import_form()​

public function import_form( $form_id, array $args=[] )

Creates the Gravity Forms form for the requested source form.

Parameters​

NameTypeDefaultDescription
$form_idmixedSource form identifier.
$argsarray[]Optional request arguments.

Returns​

  • array | WP_Error — gravity_form_id, edit_url, preview_url and warnings for the created form, or WP_Error describing the failure.

Since: %ver%

Source: src/Importers/ImporterInterface.php:101

translate_smart_tags()​

public function translate_smart_tags( string $text, array $context=[] ): string

Converts provider-specific smart tags or merge tags into Gravity Forms

merge tags.

Parameters​

NameTypeDefaultDescription
$textstringText containing provider smart tags.
$contextarray[]Optional context data for replacements.

Returns​

  • string

Since: %ver%

Source: src/Importers/ImporterInterface.php:114