Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#14802 closed enhancement (fixed)

'pre_comment_approved' filter does not provide context

Reported by: coffee2code's profile 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 15 years ago.
Patch mentioned in ticket.

Download all attachments as: .zip

Change History (3)

@coffee2code
15 years ago

Patch mentioned in ticket.

#1 @nacin
15 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.

#2 @scribu
15 years ago

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