admin管理员组文章数量:1415475
While working on a custom plugin, I needed to add the wp_editor in the admin to let the user add its own content.
I want the user to be able to write custom rich texts with the "Visual" editor mode but I also want the user to be able to paste HTML codes in the "Text" view. For example, if he wants to paste his subscription HTML form, he could do that while switching to the "Text" mode.
The issue is when I paste some HTML in the "Text" mode, after saving, the code renders with line breaks <br>
which completely changes the way the form should look.
My question is : can I prevent Wordpress from adding these line breaks if I paste some HTML code in the editor while in "Text" mode?
I've tried setting wpautop to false :
$editor_config = array(
"wpautop" => false,
"media_buttons" => true
);
wp_editor( $content, "my_editor", $editor_config );
... which doesn't change anything.
本文标签: wp editorRemoving line breaks when in text view with wpeditor
版权声明:本文标题:wp editor - Removing line breaks when in text view with wp_editor 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745186430a2646705.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论