WordPress.org

Support

Support » How-To and Troubleshooting » How to allow tag for non-admins on comments

How to allow tag for non-admins on comments

  • Hi, i add this code on my theme functions.php (for this tutorial)

    add_filter('preprocess_comment','allowpretag');
    function allowpretag($data) {
      global $allowedtags;
      $allowedtags['pre'] = array('class'=>array());
      return $data;
    }

    When admin post any comment works correctly, but when users post any comments using tag <pre>, some times works, some times dont work, example this code work for admin but not for users:

    <pre class="brush:php">
    <?php
       Echo "Hello, World!";
    ?>
    </pre>

    For admin works, but for users appear a blank line.

    When users remove tag php <?php the code works, but if the all code have other tag <?php the rest of it is ignored, example:
    this code work for admin and users:

    <pre class="brush:php">
       Echo "Hello, World!";

    Here’s my blog for test, please post comment for test http://testonly.rflfn.com/?p=1

    Note: im using this plugin
    http://wordpress.org/plugins/syntax-highlighter-compress/

    No are others plugins enabled on site.

    I would like the tag <pre> working correctly, and that all tags within it appear normally, without being ignored.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry for inccorrect syntax

    When admin post any comment works correctly, but when users post any comments using tag, some times works, some times dont work, example this code work for admin but not for users:

    I would like the tag working correctly, and that all tags within it appear normally, without being ignored.

    I have not found the solution, I think someone must already have had this problem, does anyone could help?

    The problem is not in the theme, tested with others and still the same problem.

    Thanks for your discuss, I have learned enough.

    Thanks for your discuss, I have learned enough.

    Sorry but… This is not a tutorial, this is a question for how to solve the problem with tag

    ...

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to allow tag for non-admins on comments’ is closed to new replies.