把这段代码放到 theme 里的 functions.php 文件:
function theme_pre_comment_post( $c) { $c['comment_content'] = htmlspecialchars($c['comment_content']); return $c; } add_filter( 'preprocess_comment', 'theme_pre_comment_post', '', 1);
把这段代码放到 theme 里的 functions.php 文件:
function theme_pre_comment_post( $c) { $c['comment_content'] = htmlspecialchars($c['comment_content']); return $c; } add_filter( 'preprocess_comment', 'theme_pre_comment_post', '', 1);