Custom style with tinyMCE for WordPress using tiny_mce_before_init, adds div with style to each list item instead of adding it around selection

Im trying to get tinyMCE for WordPress to apply a div with a custom sytle to a selection. Im using tiny_mce_before_init. What happens is it adds the div to each list item instead of adding it around the selection
This is my style array:

    $style_formats = array(  
    (  
        'title' => 'columna',  
        'inline' => 'div',  
        'classes' => 'bloque_izq',
        'wrapper' => true
    )
); 

And this is the html I want to wrap with the new div

Read More
<h2>Entradas</h2>
<ul>
<li>Queso Fresco en salsa</li>
<li>Queso Fresco con Rajas de Chile de Agua</li>
<li>Chile de Agua Relleno de Pollo y Nueces</li>
</ul>

And this is what hapens

<div class="bloque_izq">
<h2>Entradas</h2>
</div>
<ul>
<li>
<div class="bloque_izq">Queso Fresco en salsa</div></li>
<li>
<div class="bloque_izq">Queso Fresco con Rajas de Chile de Agua</div></li>
<li>
<div class="bloque_izq">Chile de Agua Relleno de Pollo y Nueces</div></li>
<li>
</ul>

As you can see, it applies the div to each element, instead of the whole selection. Ive tried using both inline and block, as well as both type of wrappers, and it seems to be doing the same thing. Please help!

Related posts

Leave a Reply

1 comment