Automatically add a signature to admin comments

Adding this code to the functions.php of your wordpres theme will display a signature after each admin comment. You may need to update the ID number, the default is set to ’1′ and of course change the text displayed within the signature.

Update: was an issue with the snippet, have just recently updated and tested it and is working on the newest version of wordpress.

 

 

add_filter( 'comment_text', 'my_comment_text' );
function my_comment_text( $mytext ) {
$id = get_comment(get_comment_ID())->user_id;
global $comment;
if($id == 1 ){
$mytext = get_comment_text( $comment ) . '<hr />Test comment text!';
}else{
$mytext = get_comment_text( $comment );
}
return $mytext;
}

Be Sociable, Share!

Leave a comment