Skip to content

Forms: Migrate form fields to inner blocks #42358

Description

@aaronrobertshaw

Part of: #42353
Related: #41281
Project Thread: TBA

Description

This issue finalizes the switch to form field inner blocks by introducing block deprecations that transform each form field into the new structure. We’ll also update the style syncing logic and shortcode rendering to handle child blocks correctly.

Scope & Requirements

  • Implement block deprecations mapping old attributes (label text, input type, etc.) into new Label, Input, and Option blocks.
  • Update shortcode rendering functions to collect styling data from nested blocks and apply it to generated HTML.
  • Ensure style syncing (if enabled) is compatible with multiple child blocks within a single field.

Tasks

  • Add block deprecations
    • For each current field type, define a deprecation transforming it into a parent container with inner blocks.
    • Test with posts that contain older forms to confirm a smooth upgrade experience.
  • Update shortcode rendering
    • Map nested child block attributes to the expected markup or classes.
    • Confirm frontend display remains consistent for non-migrated and migrated blocks alike
  • Refactor style syncing
    • Refactor existing HoC to a new custom hook that handles style syncing in a manner compatible with child blocks.
  • Final tests & validation
    • Add or update automated tests to confirm no regressions.
    • Check multiple field scenarios (text, email, radio, checkbox) in both old and new states.

Metadata

Metadata

Labels

EnhancementChanges to an existing feature — removing, adding, or changing parts of itTriaged[Block] FormForm block (also see Form package label)[Feature] Forms[Feature] Forms BlocksBlocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc.[Package] Forms

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions