麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > CMS > Wordpress > 正文

wordpress自動刪除重復評論方法

2024-09-07 00:51:50
字體:
來源:轉載
供稿:網友

wordpress中,已經默認加入了重復評論的限制,如果需要去掉這個限制,需要修改相應的源代碼,具體如下.

wp-includes 文件夾下面 comment.php:

  1. function wp_allow_comment($commentdata) { 
  2. global $wpdb
  3. extract($commentdata, EXTR_SKIP); 
  4. // Simple duplicate check 
  5. // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) 
  6. $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' "
  7. if ( $comment_author_email ) 
  8. $dupe .= "OR comment_author_email = '$comment_author_email' "
  9. $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"
  10. // if ( $wpdb->get_var($dupe) ) { 
  11. // do_action( 'comment_duplicate_trigger', $commentdata ); 
  12. // if ( defined('DOING_AJAX') ) 
  13. // die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 
  14. // wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 
  15. // } 
  16. do_action( 'check_comment_flood'$comment_author_IP$comment_author_email$comment_date_gmt ); 
  17. if ( isset($user_id) && $user_id) { 
  18. $userdata = get_userdata($user_id); 
  19. $user = new WP_User($user_id); 
  20. $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1"$comment_post_ID)); 
  21. if ( isset($userdata) && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) { 
  22. // The author and the admins get respect. 
  23. $approved = 1; 
  24. else { 
  25. // Everyone else's comments will be checked. 
  26. if ( check_comment($comment_author$comment_author_email$comment_author_url$comment_content$comment_author_IP$comment_agent$comment_type) ) 
  27. $approved = 1;//開源軟件:Vevb.com 
  28. else 
  29. $approved = 0; 
  30. if ( wp_blacklist_check($comment_author$comment_author_email$comment_author_url$comment_content$comment_author_IP$comment_agent) ) 
  31. $approved = 'spam'
  32. $approved = apply_filters( 'pre_comment_approved'$approved$commentdata ); 
  33. return $approved

去掉下面部分即可:

  1. // if ( $wpdb->get_var($dupe) ) { 
  2. // do_action( 'comment_duplicate_trigger', $commentdata ); 
  3. // if ( defined('DOING_AJAX') ) 
  4. // die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 
  5. // wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') ); 
  6. // } 

PS:修改前先記得備份哦.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 2018亚洲男人天堂 | 最新av在线免费观看 | 天天色综合6 | 久草在线观看首页 | 色综合久久久久久久久久久 | 成年免费视频黄网站在线观看 | 狠狠色成色综合网 | 日韩在线激情 | 精品国产91久久久 | 一级免费在线 | 在线a亚洲视频播放在线观看 | 国产激情网 | 国产成人高清在线观看 | 免费看成年人网站 | 蜜桃网站免费 | 久久国产精品免费视频 | 最新中文在线视频 | 欧美精品网址 | 久久久久免费精品国产小说色大师 | 精品国产91一区二区三区 | 精品国产一区在线 | 污视频在线免费 | 国产91亚洲精品久久久 | 中文区永久区 | 小视频免费在线观看 | 羞羞草视频 | 亚洲一区二区在线免费 | 国产午夜精品久久久久 | 久久tv免费国产高清 | 青青草成人免费视频在线 | 久久久久免费精品国产小说色大师 | 国产精品久久久久久久四虎电影 | 久久久在线免费观看 | 亚洲骚图| 男女羞羞视频 | 国产一区二区精品免费 | 超碰97人人艹 | 久久精精品 | 亚洲片在线观看 | 精品国产91久久久久久 | 毛片免费大全短视频 |