Automattic/jetpack — pull request #127 by felixarntz (2014-01-24 13:21:15+00:00)
Title: Comment Form: Easy HTML replacement

Some developers would like to modify the output and looks of the contact form. While this could partly done with CSS, it would be easier if we had comprehensive filters for that. For example when using a CSS framework like Bootstrap, we need to be able to add new classes to the `

` tag. And we would like to be able to create a submit button that matches our theme design.

For this reason, I include in this pull request:
* a new filter `grunion_contact_form_html` which passes an empty string and additional parameters: HTML content of the fields, ID, form action URL and submit button text; theme developers can create their own form HTML output there instead of the Jetpack form output; the original form's HTML from Jetpack will only be used if the form output is still empty after applying the filter
* the filter `grunion_contact_form_field_html` has been modified: it now passes all valuable variables as parameters: the ID, type, label, required, placeholder, value, options and post ID (if available); furthermore it is now executed before creating the original Jetpack form field HTML for performance issues: like in the above filter, it is only used if the output is still empty after applying the filter

I would like to see this in Jetpack to give developers full flexibility in how they want to design the contact form.

Proposals for more improvements are welcome!