示例#1
0
文件: anyLink.php 项目: yszar/linuxwp
/**
 * 把评论内容中的外链转换成内容
 * 
 * @param string $comment_text 评论内容
 * @param object $comment comment对象,默认为null
 * @return string $comment_text 返回处理后的评论内容以在页面上显示
 * @since 0.2
 */
function filter_comment($comment_text, $comment = null)
{
    $filter = new al_filter();
    if (is_null($comment)) {
        return $comment_text;
    }
    return $filter->applyFilter($comment_text, $comment->comment_ID, true);
}