I am trying to get tinyMCE for Wordpress to apply a custom sytle div to a selection. I am using tiny_mce_before_init. What happens is adding a div to each element of the list instead of adding it around the selection. This is my array of styles:
$style_formats = array( ( 'title' => 'columna', 'inline' => 'div', 'classes' => 'bloque_izq', 'wrapper' => true ) );
And this is the html that I want to wrap with a new div
<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 that 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 a div to each element, not the entire selection. Ive tried to use both the inline and the block, as well as both types of wrappers, and it seems to do the same. Please, help!
source share