The MU forums have moved to WordPress.org

KSES Plugin? (6 posts)

  1. peiqinglong
    Member
    Posted 16 years ago #

    Didn't want to reinvent the wheel if someone else has done it already, but has anyone written a MU plugin that puts ids and class tags back into allowed tags and willing to share? Thanks!

  2. lunabyte
    Member
    Posted 16 years ago #

    Why not just revert kses back to the version before that was taken out, then add that to your list of files to not overwrite?

    The code didn't change, in terms of operation, just the array of allowed tags/options.

  3. peiqinglong
    Member
    Posted 16 years ago #

    I tried that, but it gave me errors. I tried using 1.2.5 Kses. I had made note of it not to replace, but then forgot to not replace it :(.

  4. lunabyte
    Member
    Posted 16 years ago #

    You'd need a version from 1.2.1, or somewhere around in there.

    Should be fine working with 1.2.5.

  5. donncha
    Key Master
    Posted 16 years ago #

  6. peiqinglong
    Member
    Posted 16 years ago #

    Donncha,

    I read that from searching, but I'm having one of those days (possible weeks) where something that is easy to understand seems to be getting the better of me :/

    I assume I copy:

    function addabitofclass( $tags ) {
        global $allowedposttags;
        foreach( $allowedposttags as $tag => $attr ) {
            $attr[ 'class' ] = array();
            $attr[ 'id' ] = array();
            $allowedposttags[ $tag ] = $attr;
        }
        return $allowedposttags;
    }
    add_filter( 'edit_allowedposttags', 'addabitofclass' );

    wrap it with <?php and ?>
    in a blank text file and save it as kses.php into mu-plugins right?

About this Topic

  • Started 16 years ago by peiqinglong
  • Latest reply from peiqinglong