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
| Method | Description |
|---|---|
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). |
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
list_forms()
public function list_forms( array $args=[] ): array
Returns a list of importable forms.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$args | array | [] | Optional request arguments. |
Returns
array— Associative arrays carrying at leastidandtitle.
Since: %ver%
Source: src/Importers/ImporterInterface.php:64
analyze_form()
public function analyze_form( $form_id, array $args=[] )
Reports what the requested form loses on the way to Gravity Forms.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | mixed | Source form identifier. | |
$args | array | [] | 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:76
import_form()
public function import_form( $form_id, array $args=[] )
Creates the Gravity Forms form for the requested source form.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | mixed | Source form identifier. | |
$args | array | [] | Optional request arguments. |
Returns
array| WP_Error —gravity_form_id,edit_url,preview_urlandwarningsfor the created form, or WP_Error describing the failure.
Since: %ver%
Source: src/Importers/ImporterInterface.php:89
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
| Name | Type | Default | Description |
|---|---|---|---|
$text | string | Text containing provider smart tags. | |
$context | array | [] | Optional context data for replacements. |
Returns
string
Since: %ver%
Source: src/Importers/ImporterInterface.php:102