Created
September 10, 2014 18:18
-
-
Save renventura/80f7dbce39c99f1ad974 to your computer and use it in GitHub Desktop.
Reassign Admin Comments to an Author
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'] = '[email protected]'; // 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