Code to Exclude Admin Comments
-
Hello!
I recently found and added the below snippet to my theme’s functions.php to exclude my comments (the admin’s) from the default WP Recent Comments. However, I much prefer the look of this plugin’s Better Recent Comments widget.
I feel like if I were smart enough to figure out what to change “widget_comments_args” to, this snippet would work with Better Recent Comments as well. Is that not the case? If it is the case, what would I change it to?
Thanks!
function ra_recent_comments_less_author( $array ) {
global $post;
$array[‘user_id’] = !$post->post_author;
return $array;
}
add_action( ‘widget_comments_args’, ‘ra_recent_comments_less_author’ );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Code to Exclude Admin Comments’ is closed to new replies.