Skip to main content

GravityKit\GravityMigrate\Platforms\ContactForm7\ContactForm7Exporter

Exports Gravity Forms forms to Contact Form 7.

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Exporter.php:22

Details​

  • Kind: class
  • Namespace: GravityKit\GravityMigrate\Platforms\ContactForm7
  • Extends: AbstractExporter

Properties​

PropertyTypeDescription
$target_adapterTargetAdapterInterface | nullTarget adapter instance.

Methods​

MethodDescription
analyze_form()Reports what the requested Gravity Forms form loses on the way to the target provider.
export_form()Exports a Gravity Forms form to the target provider.
with_skip_mail()The additional settings with the skip_mail line present or absent, as asked.
get_target_adapter()Returns target adapter.

Method Reference​

analyze_form()​

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

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

Parameters​

NameTypeDefaultDescription
$form_idmixedGravity Forms 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/Platforms/ContactForm7/ContactForm7Exporter.php:62

export_form()​

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

Exports a Gravity Forms form to the target provider.

Parameters​

NameTypeDefaultDescription
$form_idmixedGravity Forms form identifier.
$argsarray[]Optional request arguments.

Returns​

  • array | WP_Error — target_form_id, edit_url and issues for the created form, or WP_Error describing the failure.

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Exporter.php:89

with_skip_mail()​

public static function with_skip_mail( string $settings, bool $skip_mail ): string

The additional settings with the skip_mail line present or absent, as asked.

Contact Form 7 reads settings line by line as name: value (contact-form.php:1152-1173), so the line is replaced in place rather than the box rewritten.

Parameters​

NameTypeDefaultDescription
$settingsstringThe additional settings box.
$skip_mailboolWhether the form sends nothing.

Returns​

  • string

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Exporter.php:241

get_target_adapter()​

public function get_target_adapter(): TargetAdapterInterface

Returns target adapter.

Returns​

  • TargetAdapterInterface

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Exporter.php:289