rocklobster-in / contact-form-7

Contact Form 7 - Just another contact form plugin for WordPress.
Other
292 stars 145 forks source link

Add current form instance to hidden fields filter #1499

Closed michaelw85 closed 3 weeks ago

michaelw85 commented 4 weeks ago

This small change makes it possible to access form data when adding hidden fields.

My use case: I've added custom attributes to the shortcode and want to persist this data on submit using a hidden field. This makes it possible to write custom logic on submit of the form.

takayukister commented 3 weeks ago

Use WPCF7_ContactForm::get_current()

michaelw85 commented 3 weeks ago

Use WPCF7_ContactForm::get_current()

Oops, I completely forgot this was available. Thanks, this works for my scenario.