Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#31671 closed defect (bug) (invalid)

comment_form() class_submit not working

Reported by: erikfrye's profile 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)

#1 @boonebgorges
10 years ago

  • Focuses administration removed
  • Keywords reporter-feedback added

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?

#2 @SergeyBiryukov
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.

Your line number indicates that you're on 4.0.x (ref).

Last edited 10 years ago by SergeyBiryukov (previous) (diff)

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

#4 @erikfrye
10 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Sorry about that. I have multiple instances running. I upgraded one of them, but not the one I was actually working on.

#5 @SergeyBiryukov
10 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.