Repository navigation
Import forms from Gravity Forms - #7
Merged
Merged
Conversation
Gravity keeps its forms in tables of its own — gf_form and gf_form_meta, with display_meta as JSON and the notifications and confirmations in columns beside it — so the importer reads the tables directly and works whether the plugin is active, deactivated or deleted. No GFAPI. Two conversions carry the most weight. Conditional logic is a straight translation: Gravity's flat rule list with an all/any mode is the same shape this plugin evaluates, so it maps rule for rule on fields, notifications and confirmations alike. And a List field becomes a real repeater — Gravity's columns are the repeater's sub-fields, so "add another row" keeps meaning exactly that. Products and options keep their prices ($25.00 and 10,00 € both parse), the total becomes a calculated total over them, name fields keep the parts Gravity's input numbering says are visible, field-addressed notifications keep their address, and non-submission events (payment completed, entry approved) are deliberately left behind rather than imported as mails that would fire at the wrong moment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third and final importer: Gravity Forms — the plugin whose users have the most invested, because everything it does well (conditional logic, product pricing, multi-row lists) is exactly what nobody wants to rebuild by hand.
What it does
Forms → Import gains a Gravity Forms section. Gravity keeps its forms in tables of its own —
{prefix}gf_formfor the list,{prefix}gf_form_metawithdisplay_metaas JSON and the notifications and confirmations in columns beside it — so the importer reads the tables directly, noGFAPI, and works whether the plugin is active, deactivated or already deleted. The availability check is the table's existence; the queries are two bounded reads. Nothing in Gravity's tables is ever written to.The two conversions that carry the weight
is,isnot,contains,starts_with,ends_with,>,<) mapping one to one. A rule targeting a composite input (1.3) resolves to its parent field.Everything else that converts
post_title/post_content/post_excerpt) as the input shapes they are.price(currency formatting parsed —$25.00and10,00 €both come out as numbers); a fixed-price product becomes a number holding its price; the total becomes a calculated total summing them, verified through the real calculation engine (VIP + Parking → 110.00in the tests). The honest limit: Gravity's quantity-pairing behaviour is not reproduced — the imported form is reviewable in the builder, not a silent approximation.form_submission-event notifications import — a payment-completed or entry-approved mail would fire at the wrong moment entirely, so those are deliberately left behind.toType: fieldaddressing (a bare field id into) becomes the field's merge tag rather than a mail addressed to the digit three. Subject, message, from-name, reply-to and per-notification logic all carry over.{Any Label:3}(with or without input sub-numbers or modifiers) becomes{field:…};{all_fields},{admin_email},{form_title},{ip},{embed_url},{date_mdy}/{date_dmy}map to their equivalents; unknowns stay visible rather than vanishing.enableOtherChoiceflag becomes this plugin's "Other" option;captchais dropped (spam screening here doesn't charge the visitor); unknown add-on fields become visible text fields.Verification
display_metafield for field including any-match logic and the Other flag; name-part numbering with hidden parts; List → repeater in both column shapes; products/options/total through the real calc engine with both currency formats; notifications (event filtering, field addressing, tag rewriting) and confirmations (redirect query string); and an end-to-end test that creates the realgf_form/gf_form_metatables, imports through the registry, and asserts the source tables are untouched.{Name:1.3}→{field:f1}; submit label carried over. All three importer sections now render side by side on the Import page.With this, the importer set the readme promised is complete: Contact Form 7, WPForms, Gravity Forms — one PR each, most-used first.
🤖 Generated with Claude Code
https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp