'pre_comment_approved' filter does not provide context
|Reported by:||coffee2code||Owned by:|
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.