Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#44126 new defect (bug)

Adding fields to comments_form args prevents checkbox displaying

Reported by: pross Owned by:
Milestone: 4.9.8 Priority: normal
Severity: normal Version: 4.9.6
Component: Comments Keywords: needs-patch
Focuses: docs, privacy Cc:


Steps to reproduce:

in a comments.php pass the $args to comments_form

comment_form( array(
        'fields' => array(
            'author' => 'Hello World!',

Because fields is now set the privacy checkbox will never display.

comment-template.php needs to check whether fields?cookies? is set.

Attachments (1)

44126.patch (586 bytes) - added by pross 5 weeks ago.

Download all attachments as: .zip

Change History (6)

This ticket was mentioned in Slack in #core by iandunn. View the logs.

5 weeks ago

#2 @desrosj
5 weeks ago

  • Component changed from Privacy to Comments
  • Focuses docs privacy added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.9.7

Thanks for the ticket, @pross. I tested this and I am able to reproduce.

I am going to add this to the dev note for themes that are providing arguments to comment_form(). If a theme is overriding the fields in core, I think this should be on them to add the new field. But we need to help them understand why and how. I did notice that the docblock is missing the new field, though.

We could also separate the display of this field into a different argument.

Going to mark 4.9.7 for now so that this gets looked at.

#3 @desrosj
5 weeks ago

  • Version set to 4.9.6

5 weeks ago

#4 @pross
5 weeks ago

Quick patch, still allows users to use comment_form_default_fields so they can still remove the cookies checkbox if need be.

#5 @desrosj
5 weeks ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

Note: See TracTickets for help on using tickets.