X

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.



Code Snippet:


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;
}

Comments  Leave a Reply

  1. Doesn’t work, bro. Displays signature for ALL comment authors… not just admins.

    1. Hi Ttomp,
      Your right was not sure what I was up to that day lol, anyway I updated the snippet and it is working properly now.

      1. Ernesto Marrero April 18, 2013 at 3:34 pm

        Is possible, for any way, add the boton Twitter

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!