admin管理员组文章数量:1430143
While switching between text editor mode or updating post fontawesome icon vanishes.Please do not refer to use any plugin.I think i tag is stripped by editor,how can I overcome this? My code in editor text mode
<span><i class="fa fa-user"></i></span>
or
<i class="fa fa-user"></i>
As long as I am in text mode everything is well but when I switch to visual mode all of my code gets vanish.
While switching between text editor mode or updating post fontawesome icon vanishes.Please do not refer to use any plugin.I think i tag is stripped by editor,how can I overcome this? My code in editor text mode
<span><i class="fa fa-user"></i></span>
or
<i class="fa fa-user"></i>
As long as I am in text mode everything is well but when I switch to visual mode all of my code gets vanish.
Share Improve this question edited Mar 31, 2014 at 2:07 Sadia Mehjabin asked Mar 30, 2014 at 16:46 Sadia MehjabinSadia Mehjabin 778 bronze badges 4 |2 Answers
Reset to default 3I think you should first enable i tags.Then you should enable class id or span whatever you like.To do so add this code.
function add_mce_markup( $initArray ) {
$ext = 'i[id|name|class|style]';
if ( isset( $initArray['extended_valid_elements'] ) ) {
$initArray['extended_valid_elements'] .= ',' . $ext;
} else {
$initArray['extended_valid_elements'] = $ext;
}
return $initArray;
}
add_filter( 'tiny_mce_before_init', 'add_mce_markup' );
This help me to fix this issue
Try to inser blank spave
or comment code <!--ex-->
in between i
tag like <i class="fa fa-linkedin-square" aria-hidden="true"><!--tr--></i>
So that wordpress did not recognize it as empty tag.
本文标签: tinymceFontawesome icon vanishes in editor while switching text and visual mode
版权声明:本文标题:tinymce - Fontawesome icon vanishes in editor while switching text and visual mode 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745555337a2663151.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
tiny_mce_before_init
? – Wyck Commented Mar 30, 2014 at 16:59