Главная
  • Выполненные работы
  • Партнеры
  • Услуги и цены




  • Отключить html в комментариях WordPress

    По умолчанию позволяет использовать в тексте комментариев ограниченный набор html тегов таких как a, strong и так далее. Чтобы выключить данную возможность необходимо в файл function.php для действующего шаблона добавить:

    function plc_comment_post( $incoming_comment ) {
    $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
    $incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );
    
    	return( $incoming_comment );
    }
    
    function plc_comment_display( $comment_to_display ) {
    	$comment_to_display = str_replace( ''', "'", $comment_to_display );
    	return $comment_to_display;
    }
    add_filter( 'preprocess_comment', 'plc_comment_post', '', 1);
    add_filter( 'comment_text', 'plc_comment_display', '', 1);
    add_filter( 'comment_text_rss', 'plc_comment_display', '', 1);
    add_filter( 'comment_excerpt', 'plc_comment_display', '', 1);
    

    английский оригинал

    Предыдущее сообщение:
    Следующее сообщение:

    Оставить комментарий или два

    XHTML: Вы можете использовать эти тэги: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>