WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/20/2018 12:37:40 AM (8 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r43469 r43518  
    22762276        $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    22772277                             '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
     2278
     2279        // Ensure that the passed fields include cookies consent.
     2280        if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {
     2281            $args['fields']['cookies'] = $fields['cookies'];
     2282        }
    22782283    }
    22792284
Note: See TracChangeset for help on using the changeset viewer.