fix: 修复评论只能提交一次的问题

- 将 AI 检测改回异步执行(延迟 1 秒)
- 避免同步执行阻塞评论提交流程
- 确保评论元数据先保存完成
This commit is contained in:
2026-01-22 18:52:54 +08:00
parent 2e73a1e209
commit 0290c4fea9

View File

@@ -7627,8 +7627,8 @@ function argon_auto_detect_spam_on_comment($comment_id, $comment_approved) {
}
if ($should_check) {
// 立即同步执行检测
argon_async_spam_detection_handler($comment_id);
// 异步检测(延迟 1 秒执行,让评论元数据先保存)
wp_schedule_single_event(time() + 1, 'argon_async_spam_detection', [$comment_id]);
}
}
add_action('comment_post', 'argon_auto_detect_spam_on_comment', 10, 2);