Hot answers tagged


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();


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 ...

Only top voted, non community-wiki answers of a minimum length are eligible