禁止worpdress评论中的html标记

方法一:

使用插件Peter’s Literal Comments

 

方法二:

在theme的function.php中加入下代码:

function disable_html_in_comments()
{
    global $allowedtags;
    $allowedtags = array();
}
disable_html_in_comments();

如果要允许某些tag例如A则这样;

function disable_html_in_comments()
{
    global $allowedtags;
    $allowedtags = array(
        'a' => array(
            'href' => array (),
            'title' => array ()
        )
    );
}
disable_html_in_comments();

 

参见:

http://betterwp.net/wordpress-tips/disable-html-in-comments-entirely/


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1