Make WordPress Core

Opened 5 years ago

Last modified 2 years ago

#23931 new defect (bug)

wp_insert_comment should require comment_post_ID — at Version 1

Reported by: markoheijnen Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.0
Component: Comments Keywords: needs-patch close
Focuses: Cc:

Description (last modified by markoheijnen)

At this moment there is no check for example comment_post_ID. Not sure if there are more checks needed. Reason I asked are a few notices on the unit tests caused by WP_UnitTest_Factory_For_Comment. Those comments don't add a post ID what should change.

Currently, if a null comment_post_ID is passed, the comment isn't connected to a post. This can create confusion. Also Unit tests should run with WP_Debug on.

Change History (2)

#1 @markoheijnen
5 years ago

  • Description modified (diff)

5 years ago

Simplify construction of commentdata array for insertion with defaults

Note: See TracTickets for help on using tickets.