Forms Block: Add hidden input field variation#74131
Forms Block: Add hidden input field variation#74131carolinan merged 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Please don't forget to add As he also did some effort to make this happen. |
carolinan
left a comment
There was a problem hiding this comment.
I think we should merge this, but before removing any experimental state, we could reconsider if the Advanced panel is the right place for name and value input.
Closes #57610
Why?
One of the most important fields in any form is the
hiddentype. This PR aims to add this.How?
Part of the logic and styles were already implemented but not being used. This PR takes advantage of this with the following additions:
Nameto setValue. To some extent this mimics the same behavior as Elementor forms.hiddeninput (but adding hidden in the editor, which made 0 sense). I simply took advantage of it and styled a little bit to resemble theForm Submission Notificationblock, which happens to have two hidden fields (that only appear on submission). This way, it's clear that there are hidden inputs set in the form, they are selectable without needing to unfold theDocument Overview.Testing Instructions
Very easy to test.
Form blockHidden Inputblock inside the form.Screenshots