Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Comments count for wpdiscuz
add_filter('wpdiscuz_comment_author', 'my_commentCount', 10, 2);
function my_commentCount($author_name, $comment) {
global $wpdb;
$count = $wpdb->get_var('SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. ' WHERE comment_author_email = "' . addslashes($comment->comment_author_email) . '"');
return $author_name .' | <span class="wpdiscuz-comment-count">'. $count . ' comments</span>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.