New answers tagged

1

The comment_text filter passes the comment as one of its params: echo apply_filters( 'comment_text', $comment_text, $comment, $args ); So you don't need to call get_comment_ID(), you can just access the ID from the $comment object. Change: add_filter( 'comment_text', 'modify_comment'); to: add_filter( 'comment_text', 'modify_comment', 0, 3 ); And ...


0

You can try the following code logic function THEMENAME_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; *your comment display code* }


2

You can use output buffering to achieve this effect: function get_comments_form() { ob_start(); comments_form(); $commentsform = ob_get_contents(); ob_end_clean(); return $commentsform; } $commentsform = get_comments_form();



Top 50 recent answers are included