Pass comment ID from comment_text to get_comment_text. Also add the comment object as context to the filter. fixes #14261

git-svn-id: https://develop.svn.wordpress.org/trunk@15957 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-10-25 03:11:01 +00:00
parent 49589001bb
commit d8672ca5d8

View File

@ -597,7 +597,7 @@ function comments_number( $zero = false, $one = false, $more = false, $deprecate
*/
function get_comment_text( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID );
return apply_filters('get_comment_text', $comment->comment_content);
return apply_filters( 'get_comment_text', $comment->comment_content, $comment );
}
/**
@ -610,7 +610,8 @@ function get_comment_text( $comment_ID = 0 ) {
* @param int $comment_ID The ID of the comment for which to print the text. Optional.
*/
function comment_text( $comment_ID = 0 ) {
echo apply_filters('comment_text', get_comment_text() );
$comment = get_comment( $comment_ID );
echo apply_filters( 'comment_text', get_comment_text( $comment_ID ), $comment );
}
/**