esmi have you working with custom styles in tinymce editor? I’m looking for solution that will add <i>
tag to each <li>
element.
I try this:
function custom_mce_before_init_insert_formats($init_array) {
$style_formats = array(
array(
'title' => 'arrow',
'inline' => 'i',
'classes' => 'icon',
'wrapper' => false,
'exact' => true
)
);
$init_array['style_formats'] = json_encode($style_formats);
return $init_array;
}
add_filter('tiny_mce_before_init', 'custom_mce_before_init_insert_formats');
but this add <i>
as wrapper of content of <li>
element so the result is:
<li><i class="icon">item 1</i></li>
but I want this:
<li><i class="icon"></i> item 1</li>
Thank you
[Please post all markup tags between backticks or use the code button. Post (painfully) re-constructed after it broke the forum’s topic display.]