The MU forums have moved to WordPress.org

HTML Tag Enabler (3 posts)

  1. mixle
    Blocked
    Posted 16 years ago #

    I want to be able to allow users to use html in their posts, as a lot of feeds etc are in html.
    I came across this after much searching on google

    <?php
    /*
    Plugin Name: HTML Tag Enabler
    Plugin URI: http://wordpress.org/#
    Description: Enable HTML code writing with [html]...[/html] within the post content
    Author: Ashwini Kumar Rath
    Version: 1.0
    Author URI: http://ashresort.com
    */

    function enableHTML($sContent)
    {
    $sContent = htmlentities($sContent);
    $sContent = html_entity_decode($sContent);
    $sInputCode = '/\[html\](.+?)\[\/html\]/is';
    $sContent = preg_replace_callback($sInputCode,"getOutputCode",$sContent);
    return $sContent;
    }

    function getOutputCode($matches)
    {
    $sTemp = substr(htmlentities($matches[0]),6);
    $aTemp = explode('[/html]',$sTemp);
    $sTempFinal = str_replace('\n', '
    ', $aTemp[0]);
    return $sTempFinal;
    }

    add_filter('the_content', 'enableHTML', 2);
    ?>

    Will it allow users to put html in their post and where do I place it in mu directory, is it a plugin.
    has anyone used this .

  2. drmike
    Member
    Posted 16 years ago #

    Do you mean bbcode? User can already use html in their posts as long as that html is in the wp-includes/kses.php file.

    Do you you mean that you want to display html code example for like explaining programming? If it's that, try using the 'code' tags in your posts.

  3. mixle
    Blocked
    Posted 16 years ago #

    Hi thanks for the answer, its not what I meant. This isn't a plug for my site, but it's the only way I can show you what I mean. At the bottom of my home page I have added dizzler multimedia player. What I want to know is it possible for people to add it to their blog without me having to edit the theme index page.
    My site is http://uk2uonline.info/
    Thanks

About this Topic