2010-06-22

WordPress评论转义HTML标签

Views: 21655 | Add Comments

把这段代码放到 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);

Related posts:

  1. 消除JavaScript闭包的一般方法
  2. jQuery延时绑定事件(lazy-bind)
  3. 史上最强大的PHP MySQL操作类
  4. HTTP POST using PHP cURL
  5. TextMate 2 常用配置
Posted by ideawu at 2010-06-22 13:54:47 Tags:

Leave a Comment