WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14802 closed enhancement (fixed)

'pre_comment_approved' filter does not provide context

Reported by: coffee2code Owned by:
Milestone: 3.1 Priority: normal
Severity: trivial Version:
Component: Comments Keywords: has-patch
Focuses: Cc:

Description

The 'pre_comment_approved' filter does not pass along any context to functions utilizing the hook. In particular, nothing about the comment in question is passed along. The only argument passed is the value indicating if the comment is approved/rejected/spam. Without knowing anything about the comment, the hook is of a more limited use than it could be (or at least requires more work to get at the info).

Therefore, when applying the 'pre_comment_approved' filter, ( in wp-includes/comment.php, function wp_allow_comment() ) the $commentdata sent to wp_allow_comment() should be passed along. See attachment diff.

Attachments (1)

14802.diff (406 bytes) - added by coffee2code 4 years ago.
Patch mentioned in ticket.

Download all attachments as: .zip

Change History (3)

coffee2code4 years ago

Patch mentioned in ticket.

comment:1 nacin4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15592]) Pass some context to the pre_comment_approved hook. props coffee2code, fixes #14802.

comment:2 scribu4 years ago

  • Milestone changed from Awaiting Review to 3.1
Note: See TracTickets for help on using tickets.