Skip to:
Content
Pages
Categories
Search
Top
Bottom

Allow HTML from users


  • caming
    Participant

    @caming

    What’s the best way to allow users to paste and use HTML? The problem is that there are still issues with the Visual editor, so can anyone help me allow them to use HTML?

    Thanks ~

Viewing 4 replies - 26 through 29 (of 29 total)

  • AmiNimA
    Participant

    @aminima

    I’m using this, and it works fine:

    if ( !function_exists( 'ja_filter_bbpress_allowed_tags' ) ) {
    function ja_filter_bbpress_allowed_tags() {
    return array(
     
    // Links
    'a' => array(
    'href' => array(),
    'title' => array(),
    'rel' => array()
    ),
     
    // Quotes
    'blockquote' => array(
    'cite' => array()
    ),
     
    // Code
    'code' => array(),
    'pre' => array(),
     
    // Formatting
    'em' => array(),
    'strong' => array(),
    'del' => array(
    'datetime' => true,
    ),
    'span' => array(
    'lang' => array(),
    'style' => array()
    ),
    'p' => array(
    'dir' => array(),
    'style' => array()
    ),
    'div' => array(
    'class' => array()
    ),
    // Lists
    'ul' => array(),
    'ol' => array(
    'start' => true,
    ),
    'li' => array(),
     
    // Images
    'img' => array(
    'src' => true,
    'border' => true,
    'alt' => true,
    'height' => true,
    'width' => true,
    )
    );
    }
    }
    add_filter( 'bbp_kses_allowed_tags', 'ja_filter_bbpress_allowed_tags' );

    rendi edwido
    Participant

    @rendi-edwido

    Seen your problem was solved.
    You are so nice to make the guest allow Html code.
    Cheers for you mate


    richkraetsch
    Participant

    @richkraetsch

    Is there anyone else who hasn’t gotten this code to work for them? I have tried everything and am still getting the issue of HTML showing up in quotes with quotes in them. I’ve copied this code to my includes/common/formatting.php and have seen zero change.

    (I’m using GD BBPress Tools for my quote functionality)


    Stephen Edgar
    Moderator

    @netweb

    @richkraetsch I expect this to be more of an issue with the GD BBPress Tools plugin rather than bbPress, they should have support in that plugin for the custom HTML tags it is using.

    You can also try this plugin (and remove that custom code you added), I just added div and sub element class to this and it should work for you, you will need to double check and modify it to remove any HTML tags you do not need, also the next release of bbPress includes some more changes to the allowed KSES HTML tags so you’ll need to update and possibly make some more changes once bbPress 2.6 is released.

    https://gist.github.com/ntwb/7797990

Viewing 4 replies - 26 through 29 (of 29 total)
  • You must be logged in to reply to this topic.
Skip to toolbar