Skip to content

Commit

Permalink
小工具栏-关于博主评论计数修改为只统计批准的评论数
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyueerhao committed Mar 27, 2023
1 parent 7984468 commit 4c9bb39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/fun/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ function widget( $args, $instance ){
$cover = $instance['cover'];
$comment_num = pk_cache_get(PKC_TOTAL_COMMENTS);
if(!$comment_num){
$comment_num = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments");
$comment_num = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved =1");
pk_cache_set(PKC_TOTAL_COMMENTS, $comment_num);
}
?>
Expand Down

0 comments on commit 4c9bb39

Please sign in to comment.