问题再现步骤:
打开WordPress管理面板(我使用3.7版)添加页面<p>Lorem ipsum dolor sit amet</p><br> 内容区域上<p>Lorem ipsum dolor sit amet</p><br> 格式已丢失,显示为:
Lorem ipsum dolor sit amet
如何停用此TinyMCE问题以保持完全原始的格式?(我正在编辑器的JavaScript客户端上寻找解决方案)问题再现步骤:
打开WordPress管理面板(我使用3.7版)添加页面<p>Lorem ipsum dolor sit amet</p><br> 内容区域上<p>Lorem ipsum dolor sit amet</p><br> 格式已丢失,显示为:
Lorem ipsum dolor sit amet
如何停用此TinyMCE问题以保持完全原始的格式?(我正在编辑器的JavaScript客户端上寻找解决方案)保存后,标签将自动添加到内容中。只有当你有一个简单的<p>....</p>
但如果你有<p class=\'something\'>...</p>
它会保护它。
您可以添加:
"wpautop" => false
作为wp\\u编辑器的参数。示例(里程可能有所不同):
$args = array(
"textarea_name" => $this->option_name . "[editor_text]", // Name of the textarea on the forms, this value is passed when submitting the form.
"textarea_rows" => 15, // The number of rows textarea displays.
"wpautop" => false, // So <p> tags are not removed going from text->visual->text in editor.
"editor_class" => "my_editor_custom_css" // Additional CSS classes added to the TinyMce editor.
);
echo wp_editor($display_text, "my_editor_html_id", $args);
请注意,您必须使用<p> </p>
标签,而不是<br>
但不管怎样,这是目前首选的方式,因为它可以让您在不接触html的情况下使用css进行格式化。我通常不推荐使用插件来解决类似的问题,但是TinyMCE Advanced 由核心WP开发人员开发,并提供此选项。这是我创建的每个WP站点上的主要插件之一。
我已经安装了PSpell并更新了配置文件以使用它而不是GoogleSpell。然后在我的函数文件中,我在插件部分和按钮中添加了拼写检查器。按钮出现了,但不起作用。查看源代码后,我发现TinyMCE init中没有包含拼写检查器。function customize_tinymce($in) { $in[\'remove_linebreaks\'] = false; $in[\'gecko_spellcheck\'] = false; $in[\'keep_styles\'] = t