Created
April 6, 2017 05:35
-
-
Save Kaiderella/c2e247b0a1f55827ccda56c9a0085089 to your computer and use it in GitHub Desktop.
Comments count for wpdiscuz
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
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