-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forms: Allow ability to add hidden fields #40860
base: trunk
Are you sure you want to change the base?
Conversation
…end, including a filter to allow for options such as dynamic population.
… - one at a time.
…insecure UUID generation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
* @param string $form_html The complete form HTML. | ||
* @param array $atts The block attributes. | ||
*/ | ||
return apply_filters( 'grunion_modify_rendered_contact_form_html', $form_html, $atts ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we've used grunion_
a lot in code (and probably filters) in the past but I thin we could move towards jetpack_
prefix by now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I noticed that later as well, but instead of changing it I've removed this filter entirely and will be replacing with another elsewhere. I'll send you a message when ready (shortly), as the PR isn't good for reviewing just yet (additional items to be removed as well, will cause confusion otherwise.).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 👍 sorry for jumping early onto this, I appreciate it's in draft still :-)
… adjusted, to the hidden_fields_filter function.
…ving the framework behind for the future.
… commit as used in [post_id] template
|
||
// If there's more than one form block on the page we can't tell | ||
// which one is being submitted, abort. | ||
// TODO: solve it or inform the user about this limitation! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related, adding unique IDs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll drop a comment over there with a few thoughts shortly.
…uplicate name value pairs.
Fixes #21241
Proposed changes:
Additional notes:
Other information:
Jetpack product discussion
#21241
See also https://github.com/Automattic/vulcan/issues/601
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
On a self-hosted or WoA site, apply this PR via the Jetpack Beta plugin or locally. On Simple, with a sandboxed Simple site apply the changes using the command in the generated comment below.
Form response data and exporting data:
wp-admin/edit.php?post_type=feedback
and ensure the hidden field data is there.Testing form filters:
wp-admin/edit.php?post_type=feedback
- you should see one entry for [post_id] with the post id, and you should see one entry with the name 'Custom Name' and value of 'Custom Value'. There should be no entry for 'Test' with the value 'Demo'.wp-admin/edit.php?post_type=feedback
- you should see one entry for 'No post ID' with the post id, as well as the changed values from the previous values (or the original name / value pair values for those hidden fields if the other snippet is deactivated).