Skip to content

Forms: allow more core blocks inside forms#47121

Merged
simison merged 9 commits intotrunkfrom
update/forms-unlock-new-blocks
Feb 13, 2026
Merged

Forms: allow more core blocks inside forms#47121
simison merged 9 commits intotrunkfrom
update/forms-unlock-new-blocks

Conversation

@simison
Copy link
Copy Markdown
Member

@simison simison commented Feb 13, 2026

Proposed changes:

  • Add core/accordion, core/icon, and core/details to the list of allowed core blocks that can be used inside Jetpack form blocks.
  • Allow icon block inside dropzone
Screenshot 2026-02-13 at 12 03 13 Screenshot 2026-02-13 at 11 56 37 Screenshot 2026-02-13 at 11 56 41 Screenshot 2026-02-13 at 11 56 33

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

The icon block was just added (WordPress/gutenberg#71227) to Gutenberg in preparation to be included in WP 7.0, so you might need to run the latest trunk and enable a couple of experiments to see it:

Screenshot 2026-02-13 at 11 57 56 Screenshot 2026-02-13 at 11 58 09

Test icon block inside file upload field.

You can just find the accordion and details blocks in the block inserter normally. Try adding fields inside them.

@simison simison requested review from a team, Copilot and ilonagl February 13, 2026 10:14
@simison simison added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Package] Forms [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. Enhancement labels Feb 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the update/forms-unlock-new-blocks branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-unlock-new-blocks

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Block] Form Form block (also see Form package label) [Feature] Forms labels Feb 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: March 3, 2026
    • Code freeze: March 3, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Jetpack Forms block editor by allowing additional core WordPress blocks (accordion, icon, and details) to be used inside forms. The changes consolidate the allowed core blocks list between PHP and JavaScript implementations, ensuring consistency across the codebase.

Changes:

  • Added core/accordion, core/icon, and core/details to the allowed blocks list in both PHP and JavaScript
  • Added core/button, core/column, and core/list-item to JavaScript constants to match the PHP implementation
  • Enabled core/icon block in the file upload dropzone
  • Added corresponding changelog entries

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
projects/packages/forms/src/form-editor/class-form-editor.php Updated PHP allowed blocks list to include new core blocks (accordion, icon, details, etc.)
projects/packages/forms/src/blocks/shared/util/constants.js Synchronized JavaScript CORE_BLOCKS constant with PHP by adding missing blocks
projects/packages/forms/src/blocks/dropzone/index.js Added core/icon to the dropzone's allowed blocks
projects/packages/forms/changelog/allow-icon-in-dropzone Changelog entry for dropzone icon block support
projects/packages/forms/changelog/add-core-blocks-to-forms Changelog entry for consolidating allowed core blocks

@jp-launch-control
Copy link
Copy Markdown

jp-launch-control bot commented Feb 13, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/form-editor/class-form-editor.php 72/93 (77.42%) 0.50% 0 💚

Full summary · PHP report · JS report

Copilot AI review requested due to automatic review settings February 13, 2026 10:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment on lines 78 to +100
@@ -96,17 +95,20 @@ public static function allowed_blocks_for_jetpack_form( $allowed_block_types, $e
'jetpack/form-progress-indicator',

// Core blocks for rich content.
'core/accordion',
'core/audio',
'core/button',
'core/button', // Used for the submit button.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comments about which block is used for the submit button are misleading/inconsistent. The form editor still programmatically creates a jetpack/button submit button (see projects/packages/forms/src/form-editor/index.tsx), while this list claims core/button is used for submit and jetpack/button was only used previously. Consider rewording these comments to reflect that both jetpack/button (legacy) and core/button (current) may exist for backwards compatibility, or remove the submit-button-specific wording altogether.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

@simison simison Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enejb, can you check if the above is true, and we need to update it to use the core button instead if it is.

(Let's keep the comment as-is.)

@simison simison added the Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change. label Feb 13, 2026
Copilot AI review requested due to automatic review settings February 13, 2026 10:47
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Feb 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines 97 to 101
// Core blocks for rich content.
'core/accordion',
'core/audio',
'core/button',
'core/button', // Used for the submit button.
'core/code',
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowed core block list for the form CPT was expanded here, but the existing PHPUnit coverage for Form_Editor::allowed_blocks_for_jetpack_form() doesn’t assert any of these newly-allowed blocks. Please update projects/packages/forms/tests/php/form-editor/Form_Editor_Test.php::test_allowed_blocks_for_jetpack_form_restricts_blocks to include assertions for core/accordion, core/details, and core/icon so future regressions are caught.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is legit and low effort.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vianasw
vianasw previously approved these changes Feb 13, 2026
Copy link
Copy Markdown
Contributor

@vianasw vianasw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works. It would be nice to also update the list in the tests for allowed_blocks_for_jetpack_form.

simison and others added 6 commits February 13, 2026 15:30
Synchronize the allowed core blocks lists in both JavaScript
(constants.js) and PHP (Form_Editor class) by adding:
- core/accordion, core/icon, core/details (new additions)
- core/button, core/column, core/list-item (for consistency)

This ensures both the block editor and server-side filtering
allow the same set of core blocks inside forms.

Co-authored-by: Cursor <cursoragent@cursor.com>
Enable the core/icon block to be added inside the dropzone block,
allowing users to customize the file upload UI with icons.

Co-authored-by: Cursor <cursoragent@cursor.com>
- sort
- remove duplicate button
- comment on buttons
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
simison and others added 3 commits February 13, 2026 15:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@simison simison force-pushed the update/forms-unlock-new-blocks branch from d73fc7b to 9d1b282 Compare February 13, 2026 13:32
@simison simison merged commit 871d609 into trunk Feb 13, 2026
72 checks passed
@simison simison deleted the update/forms-unlock-new-blocks branch February 13, 2026 15:39
@github-actions github-actions bot added this to the jetpack/15.6 milestone Feb 13, 2026
@github-actions github-actions bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Form Form block (also see Form package label) Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Feature] Forms [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change. [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants