mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.
The `comment_form_default_fields` filter can be used to remove the checkbox. Props pross, SergeyBiryukov. Fixes #44126. git-svn-id: https://develop.svn.wordpress.org/trunk@43518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2275,6 +2275,11 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
|
||||
$fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
|
||||
'<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
|
||||
|
||||
// Ensure that the passed fields include cookies consent.
|
||||
if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {
|
||||
$args['fields']['cookies'] = $fields['cookies'];
|
||||
}
|
||||
}
|
||||
|
||||
$required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
|
||||
|
||||
Reference in New Issue
Block a user