-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Omit novalidate
from comment form by default but introduce novalidate
arg to override
#8858
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
Changes from 4 commits
2754f67
cbd92d2
c5f8820
04b4343
585d151
3550454
234cd63
e0e8b5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2446,6 +2446,7 @@ function wp_list_comments( $args = array(), $comments = null ) { | |
* @since 4.6.0 Introduced the 'action' argument. | ||
* @since 4.9.6 Introduced the 'cookies' default comment field. | ||
* @since 5.5.0 Introduced the 'class_container' argument. | ||
* @since n.e.x.t Introduced the 'novalidate_form' argument. | ||
* | ||
* @param array $args { | ||
* Optional. Default arguments and form fields to override. | ||
|
@@ -2467,6 +2468,7 @@ function wp_list_comments( $args = array(), $comments = null ) { | |
* Default 'Your email address will not be published.'. | ||
* @type string $comment_notes_after HTML element for a message displayed after the textarea field. | ||
* @type string $action The comment form element action attribute. Default '/wp-comments-post.php'. | ||
* @type bool $novalidate_form Whether the novalidate attribute is added to the comment form. Default false. | ||
* @type string $id_form The comment form element id attribute. Default 'commentform'. | ||
* @type string $id_submit The comment submit element id attribute. Default 'submit'. | ||
* @type string $class_container The comment form container class attribute. Default 'comment-respond'. | ||
|
@@ -2646,6 +2648,7 @@ function comment_form( $args = array(), $post = null ) { | |
), | ||
'comment_notes_after' => '', | ||
'action' => site_url( '/wp-comments-post.php' ), | ||
'novalidate_form' => false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if this would be clearer as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. I picked this name to parallel to keys like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense; it just doesn't follow the pattern used elsewhere in the same array. E.g. 'action' => "value of the action attribute". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By that argument, maybe it would just be 'novalidate' => false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency, apparently, is hard. ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It couldn't be relevant to any other element anyway, same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For another idea: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so because the other keys don't use a verb like that in this function. I like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think just 'novalidate' makes sense. As @westonruter says, it's not valid on any other element, and it matches the method used for 'action'. Let's go with that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, there we are! 3550454 |
||
'id_form' => 'commentform', | ||
'id_submit' => 'submit', | ||
'class_container' => 'comment-respond', | ||
|
@@ -2729,7 +2732,7 @@ function comment_form( $args = array(), $post = null ) { | |
esc_url( $args['action'] ), | ||
esc_attr( $args['id_form'] ), | ||
esc_attr( $args['class_form'] ), | ||
( $html5 ? ' novalidate' : '' ) | ||
( $args['novalidate_form'] ? ' novalidate' : '' ) | ||
); | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this placeholder version since I wasn't sure how long it would take to merge this or if we'd target it for 6.8.2. But seems like it makes sense for a minor release, especially with the current relaxation of the criteria.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree; 6.8.2 seems reasonable. But with all the changes recently, I honestly don't have any idea...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 234cd63