WordPress.org

Ready to get started?Download WordPress

Forums

Allow users to edit font attributes in comments (5 posts)

  1. Sproke
    Member
    Posted 8 years ago #

    Hey everyone. I'm having trouble with this particular issue.
    I have done some searching, but have found that to do this, I need to edit the kses.php file. I have managed to get images to show, now I would just like to allow commenters to be able to have the font colours and sizes that they want.

    I also know that I need to add the code
    'font' => array('color' => array()),

    into this section of the kses.php file, but I am unsure where to place it to make it work

    This is the code that I have so far.

    $allowedtags = array ('a' => array ('href' => array (), 'title' => array ()), 'font' => array('color' => array()), 'img' => array( 'src' => array(), 'alt' => array()), 'abbr' => array ('title' => array ()), 'acronym' => array ('title' => array ()), 'b' => array (), 'blockquote' => array ('cite' => array ()),

    Please Help!!

    ~~*~~
    For extra information though it doesn't really attirbute to my problem: I am using editormonkey, and am using the TinyMCE/simple controls. I want my readers to be able to have full use of the controls.

  2. Kafkaesqui

    Posted 8 years ago #

    I'm not sure why they (i.e. whomever was responsible) pushed some of the $allowedtags array onto one line, but you'll note it continues on from there:

    //      'br' => array(),
    'code' => array (),

    etc...

    It ends here:

    //      'ul' => array(),
    );

    Slip your entry for font in here at the end:

    //      'ul' => array(),
    'font' => array('color' => array()),
    );

  3. Sproke
    Member
    Posted 8 years ago #

    Hey thanks so much for your help. I tried and I tried, and I revised and I tried again, but nothing has work.
    This is what I've tried:

    1)
    // 'ul' => array(),
    'font' => array('color' => array()),
    );

    2)
    // 'ul' => array(),
    'font' => array ('color' => array()),
    );

    3)
    used font tags in the comments instead of the pick a colour in the WYSIWYG editor from editormonkey.

    Anymore ideas?

  4. Sproke
    Member
    Posted 8 years ago #

    Also tried this:
    // 'ul' => array(), 'font' => array ('color' => array()),
    (all on the one line)

  5. Kafkaesqui

    Posted 8 years ago #

    The one from your last reply will not work because a line in a PHP file with // at the beginning is commented out (i.e. ignored). If placing it in kses.php as I show above didn't work, then something else has to be going on in the background, or it wasn't added to the correct array.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.