我正在尝试配置后端的评论屏幕以适合我的项目。通过解决这个问题,我已经迈出了第一步:
Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins
现在,我想让查看所有收到评论的帖子作者无法查看评论人的电子邮件帐户。我有点担心,一些作者可能会创建一些帖子,只是为了接收大量评论,并能够看到其后端的所有电子邮件帐户,从而将其用于垃圾邮件目的。
是否可以保留评论者的电子邮件帐户,以便管理员查看?谢谢
我已经在网上找了几个小时了,但我找到的唯一一种插件已经有6年的历史了,而且不起作用
/*
Plugin Name: Erase Commenter Details
Plugin URI: http://wordpress.org/support/topic/143772
Description: Removes IP, e-mail and URL of comment authors from Comments admin when viewed by \'contributors.\'
Version: R1
Author: Kaf Oseo
Author URI: http://szub.net
Copyright (c) 2007 Kaf Oseo (http://szub.net)
Erase Commenter Details is released under the GNU General Public License
http://www.gnu.org/licenses/gpl.txt
This is a WordPress plugin (http://wordpress.org).
*/
function szub_erase_commenter_details($text) {
if( !current_user_can(\'publish_posts\') ) {
$patterns = array(\'/ \\| <a href=\\\'.*\\\' rel=\\\'external\\\'>.*<\\/a>/\', \'/ \\| \' . __(\'IP\') . \': <a href=.*<\\/a>/\', \'/ \\| <a href=\\\'mailto:.*<\\/a>/\', \'/<th scope="col">(\' . __(\'E-mail\') . \'|\' . __(\'IP\') . \')<\\/th>/\', \'/<td>(<a href=(\\\'mailto|"edit-comments\\.php).*<\\/a>)?<\\/td>/\');
$text = preg_replace($patterns, \'\', $text);
}
return $text;
}
if( strpos($_SERVER[\'REQUEST_URI\'], \'wp-admin/edit-comments.php\') ) {
ob_start(\'szub_erase_commenter_details\');
}