WordPress Visual Editor Stripping HTML Changes
-
When I use the WordPress HTML editor to add icomoon icons like this
<span class="icon-shield"></span>
and then switch to the visual editor and then back to the HTML editor, the icons disappear. I am trying to include this bit of Javascript to fix this. I looked at wp_enqueue_scripts and put this in functions.php, but it still doesn’t fix the problem.
function oakwood_tinymcefix() { wp_enqueue_script( 'tiny_mce' ); echo '<script type="text/javascript">' , 'tinymce.init({ ... extended_valid_elements : "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]" });' , '</script>'; } add_action( 'admin_enqueue_scripts', 'oakwood_tinymcefix' );
How can I fix this?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WordPress Visual Editor Stripping HTML Changes’ is closed to new replies.