• I am having problems with my attributes being removed from span tags.
    I have been reading about this issue on the forum but I don’t seem to see any real solutions.
    To get the span tags to remain I added to functions.php

    function myextensionTinyMCE($init) {
        $ext = 'span[id|name|class|style]';
        if ( isset( $init['extended_valid_elements'] ) ) {
            $init['extended_valid_elements'] .= ',' . $ext;
        } else {
            $init['extended_valid_elements'] = $ext;
        }
        return $init;
    }
    add_filter('tiny_mce_before_init', 'myextensionTinyMCE' );

    So now the span tags themselves remain however I have an unordered list that looks like this:

    <ul>
    <li><span onmouseover="show_image('one.jpg')">Phil Butendorp</span></li>
    <li><span onmouseover="show_image('two.jpg')">Ted Some</span></li>
    </ul>

    but if you switch to the visual tab the attribute is removed

    <ul>
    <li><span>Phil Butendorp</span></li>
    <li><span>Ted Some</span></li>
    </ul>

    Does anyone know how to get this to work?

    thank you

  • The topic ‘Onmouseover removed from span tags’ is closed to new replies.