Commit 7da3574
committed
Comments: Remove
Browser support for client-side validation is now reliable. Blocking the form submission when there is a missing/invalid field prevents the possibility of losing comment content when bfcache does not restore the previous page when going back.
To retain the `novalidate` attribute, the `comment_form()`'s args now accepts a `novalidate` key which will add the attribute when it is `true`. This can also be supplied by the `comment_form_default_fields filter`, for example:
{{{
add_filter( 'comment_form_defaults', function ( $args ) {
$args['novalidate'] = true;
return $args;
} );
}}}
Reviewed by audrasjb.
Merges [60304] to the 6.8 branch.
Fixes #47595.
Props westonruter, joedolson, sabernhardt, afercia, SergeyBiryukov, guddu1315, pfefferle, oglekler, bugnumber9.
git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60412 602fd350-edb4-49c9-b593-d223f7449a82novalidate attribute from comments form by default.1 parent f41ae1e commit 7da3574
File tree
2 files changed
+38
-1
lines changed- src/wp-includes
- tests/phpunit/tests/comment
2 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2446 | 2446 | | |
2447 | 2447 | | |
2448 | 2448 | | |
| 2449 | + | |
2449 | 2450 | | |
2450 | 2451 | | |
2451 | 2452 | | |
| |||
2467 | 2468 | | |
2468 | 2469 | | |
2469 | 2470 | | |
| 2471 | + | |
2470 | 2472 | | |
2471 | 2473 | | |
2472 | 2474 | | |
| |||
2646 | 2648 | | |
2647 | 2649 | | |
2648 | 2650 | | |
| 2651 | + | |
2649 | 2652 | | |
2650 | 2653 | | |
2651 | 2654 | | |
| |||
2729 | 2732 | | |
2730 | 2733 | | |
2731 | 2734 | | |
2732 | | - | |
| 2735 | + | |
2733 | 2736 | | |
2734 | 2737 | | |
2735 | 2738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
196 | 230 | | |
0 commit comments