Make WordPress Core


Ignore:
Timestamp:
07/24/2018 12:42:33 PM (7 years 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.
Merges [43518] to the 4.9 branch.
Fixes #44126.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/comment-template.php

    r43470 r43524  
    22102210        $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    22112211                             '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
     2212
     2213        // Ensure that the passed fields include cookies consent.
     2214        if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) {
     2215            $args['fields']['cookies'] = $fields['cookies'];
     2216        }
    22122217    }
    22132218
Note: See TracChangeset for help on using the changeset viewer.