[wp-trac] [WordPress Trac] #24913: comment_text filter used differently in two places in core
WordPress Trac
noreply at wordpress.org
Thu Aug 1 15:21:52 UTC 2013
#24913: comment_text filter used differently in two places in core
--------------------------+--------------------------------------
Reporter: ronalfy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 3.6
Severity: normal | Keywords: 2nd-opinion dev-feedback
--------------------------+--------------------------------------
The 'comment_text' filter is being used differently in two different
places in core.
For the life of me, I can't figure out why.
The first instance is being used as a comment is posted in /wp-
includes/comment.php, passing only one argument:
{{{
$comment = apply_filters( 'comment_text', $comment );
}}}
The 2nd instance is being used when a comment is displayed in /wp-includes
/comment-template.php, passing two arguments.
{{{
echo apply_filters( 'comment_text', get_comment_text( $comment_ID ),
$comment );
}}}
The problem is, if someone is hooked into the 'comment_text' filter and is
expecting two arguments, the 2nd one won't be set when a comment is
posted.
I recommend changing the filter name 'comment_text' when the comment is
being posted.
Thoughts?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24913>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list