这是一个简单的留言处理,功能是将HTML代码转换为实体,目前应该没有实际的用途,只是记录一下,希望以后用的着的!
<?php
/*
Plugin Name: HtmlCode
Plugin URI:
Description:
Version:
Author:
Author URI:
Contributor:
*/
function HtmlCode($comment) {
$comment = nl2br(htmlspecialchars($comment));
$comment = str_replace('<p>', '<p>', $comment);
$comment = str_replace('</p>', '</p>', $comment);
$comment = str_replace('<br />', '<br />', $comment);
echo $comment;
}
add_filter('comment_text', 'HtmlCode', 999);
add_filter('comment_excerpt', 'HtmlCode', -999);
?>






2008.10.23 8:28 am
感觉多有用,先收藏了。
2008.10.25 9:34 pm
Write quite good.Give you to encourage, next time again come to your crest once(*__*)