#31671 closed defect (bug) (invalid)
comment_form() class_submit not working
Reported by: | erikfrye | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1.1 |
Component: | Comments | Keywords: | |
Focuses: | ui, template | Cc: |
Description
Using the argument class_submit in comment_form() is not appending the classes to the comment form button.
Following the documentation at http://codex.wordpress.org/Function_Reference/comment_form, I should be able to add 'class_submit' => 'something'. However, when I dug into comment-template.php, on line 2233 I saw no mention of adding in the classes.
<input name="<?php echo esc_attr( $args['name_submit'] ); ?>" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
Everything worked fine when I added in
class="<?php echo esc_attr( $args['class_submit'] ); ?>"
The new line 2233 would look like this
<input name="<?php echo esc_attr( $args['name_submit'] ); ?>" type="submit" class="<?php echo esc_attr( $args['class_submit'] ); ?>" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
Change History (5)
#2
@
10 years ago
The new line 2233 would look like this
<input name="<?php echo esc_attr( $args['name_submit'] ); ?>" type="submit" class="<?php echo esc_attr( $args['class_submit'] ); ?>" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
It already looks like this, see [29809]. Make sure you're on 4.1.x or 4.2-beta.
This ticket was mentioned in Slack in #core by drew. View the logs.
10 years ago
Note: See
TracTickets for help on using
tickets.
erikfrye - The way the submit button is built has been refactored for 4.2. See #15015 [31699]. It appears that 'class_submit' should be respected. Can you have a look at the latest trunk to see if the problem persists?