From b3cd3747d3fba8637836af74bafd9167da8b6e49 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Fri, 23 Jan 2026 16:49:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20AI=20=E5=AE=A1?= =?UTF-8?q?=E6=9F=A5=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E5=8F=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=84=E8=AE=BA=E5=AE=A1=E6=9F=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在批量扫描结果中添加 username_invalid 字段 - 区分显示评论审查和用户名审查 - 在理由前添加审查类型标识(评论审查/用户名审查) - 保存完整的检测结果到评论元数据 --- functions.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index f5da839..9aa4d95 100644 --- a/functions.php +++ b/functions.php @@ -8231,18 +8231,31 @@ function argon_spam_detection_scan() { if (isset($item['is_spam']) && $item['is_spam']) { $comment = get_comment($comment_id); if ($comment) { + // 检查是否有用户名问题 + $username_invalid = isset($item['username_invalid']) ? $item['username_invalid'] : false; + $reason = isset($item['reason']) ? $item['reason'] : __('未知原因', 'argon'); + + // 如果有用户名问题,在理由中标注 + if ($username_invalid) { + $reason = __('用户名审查:', 'argon') . $reason; + } else { + $reason = __('评论审查:', 'argon') . $reason; + } + $spam_results[] = [ 'comment_id' => $comment_id, 'author' => $comment->comment_author, 'content' => mb_substr(strip_tags($comment->comment_content), 0, 100), - 'reason' => isset($item['reason']) ? $item['reason'] : __('未知原因', 'argon'), - 'detection_code' => $detection_code + 'reason' => $reason, + 'detection_code' => $detection_code, + 'username_invalid' => $username_invalid ]; // 保存检测结果 update_comment_meta($comment_id, '_argon_spam_detection_result', [ 'is_spam' => true, - 'reason' => $item['reason'] + 'reason' => $item['reason'], + 'username_invalid' => $username_invalid ]); } } else {