#20446 closed enhancement (fixed)
Add comment form submit button class attribute
Reported by: | bainternet | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.3.1 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
The comment_form() is packed with filters all over the place to customize the from just the way you need, but one thing i find missing is a class on the submit input tag and if there was a class attribute then it should be filterable.
I know you can set the input ID and simply style based on the ID selector but when designing themes usually you have some kind of class defined for buttons, especially when using any of the html5/responsive theme frameworks and if the comment submit input had a class which was filterable then it would make our lives much easier.
Attachments (1)
Change History (18)
#2
@
12 years ago
- Keywords has-patch 2nd-opinion needs-testing added
Added patch to handle the comment form submit input class
ex:
comment_form(array('class_submit'=>'myclass'));
#4
@
12 years ago
- Version set to 3.3.1
Related: #15015 (patch there provides a solution that allows adding 'class' attribute to comment form submit button)
#5
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of #15015.
#6
@
11 years ago
- Resolution duplicate deleted
- Status changed from closed to reopened
Id is not a class and this ticket isn't duplicate.
It's a missed feature for templating, if you use bootstrap or other templating/css framework.
I have tested the patch and it works fine.
#8
follow-up:
↓ 9
@
11 years ago
- Keywords reporter-feedback added; needs-testing removed
- Milestone set to Awaiting Review
Looking at the code, .comment-form input[type="submit"]
should work for styling purposes:
tags/3.8.1/src/wp-includes/comment-template.php#L2120
Why do you need a specific class for that button?
#9
in reply to:
↑ 8
;
follow-up:
↓ 10
@
11 years ago
Replying to SergeyBiryukov:
Looking at the code,
.comment-form input[type="submit"]
should work for styling purposes:
tags/3.8.1/src/wp-includes/comment-template.php#L2120
Why do you need a specific class for that button?
There are lots of reasons why you might want classes on a submit button. In my case, I need it because twitter bootstrap needs a class on all of it's submit buttons to get the correct styling.
#10
in reply to:
↑ 9
@
11 years ago
Agree with spacedmonkey. No doubt that it is possible to style the button using the id. But if you are using bootstrap and less and do something like this:
#submit { .btn; .btn-primary; }
After compiling, your css file becomes 2Kb heavier because all the bootstrap button styles are now applied one more time to our tiny button. If there was a possibility to add class this could be avoidable. I agree it's not 100% semantically correct but good in terms of saving bandwidth.
#11
@
11 years ago
Everything else in the form is overridable apart from this one thing. It seems like a small thing and the patch has already been written, I don't see the issue with added this extra functionality?
#13
@
10 years ago
- Keywords reporter-feedback removed
- Milestone changed from Awaiting Review to Future Release
should be very simple , I'll upload a patch as soon as i get home.