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 26 replies (of 26 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' );
Viewing 26 replies (of 26 total)

You must be logged in to reply to this topic.