Skip to content
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

Grunion Contact Form suggestion: make input fields and "push button" class filterable #7613

Closed
jimmyandrade opened this issue Aug 9, 2017 · 2 comments
Labels
[Feature] Contact Form Good For Community [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@jimmyandrade
Copy link
Contributor

Often, my themes use a framework such as Bootstrap - which have input & button-specific classes - and it is not good to change the CSS code to change the appearance of the Grunion Contact Form elements.

So my proposal would be to make the class attribute of inputs and buttons filterable, so that I can add the classes I want without having to hack the WordPress core or my CSS framework.

On the inputs, this line is responsible for the class:

$class = $this->get_attribute( 'class' );

In the case of the button, we would need to change this line mainly:

$r .= "\t\t<input type='submit' value='" . esc_attr( $form->get_attribute( 'submit_button_text' ) ) . "' class='pushbutton-wide'/>\n";

I want to submit a PR, but I'm posting this issue here to collect opinions.

@jeherve jeherve added [Feature] Contact Form [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Sep 7, 2017
@rodruiz
Copy link
Contributor

rodruiz commented Oct 6, 2017

Could you add the new attribute 'submit_button_class'?
Then:

$r .= "\t\t<input type='submit' value='" . esc_attr( $form->get_attribute( 'submit_button_text' ) ) . "' class='" . esc_attr( $form->get_attribute( 'submit_button_class' ) ) . "'/>\n";

Thank you!

@jeherve
Copy link
Member

jeherve commented Dec 14, 2017

also suggested here:
https://twitter.com/wavetree/status/941390483829547009

jeherve pushed a commit that referenced this issue Sep 7, 2018
Fixes #7613

#### Changes proposed in this Pull Request:

* Make the `class` attribute of inputs and buttons filterable, so that developers can add the classes without having to hack the WordPress core or CSS framework.

#### Proposed changelog entry for your changes:
* Now developers can use the `grunion_contact_form_submit_button_class` and `grunion_contact_form_input_class`filters to customize the `class` attributes of inputs and buttons in Contact Form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Contact Form Good For Community [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

3 participants