Skip to content

Instantly share code, notes, and snippets.

@renventura
Created September 10, 2014 18:18
Show Gist options
  • Save renventura/80f7dbce39c99f1ad974 to your computer and use it in GitHub Desktop.
Save renventura/80f7dbce39c99f1ad974 to your computer and use it in GitHub Desktop.
Reassign Admin Comments to an Author
<?php //* mind this opening php tag
//* Make Admin Comments Become Author Comments
add_filter( 'preprocess_comment', 'rv_admin_comments_to_author_comments' );
function rv_admin_comments_to_author_comments( $comment_data ) {
if ( $comment_data['user_ID'] == 1 ) { // Change 1 to your admin ID
$comment_data['user_ID'] = 8; // Change 8 to your Author ID
$comment_data['comment_author'] = 'Your Name'; // Enter the name you want to appear in comments
$comment_data['comment_author_email'] = 'test@example.com'; // Enter your Gravatar email
$comment_data['comment_author_url'] = 'http://engagewp.com'; // Enter your website URL
}
return $comment_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment