我已经将wordpress的tinymce编辑器集成到我的自定义插件中。我通过ajax将输入的数据保存到数据库中,如下所示:
encodeURIComponent(\'<?php echo mysql_real_escape_string(stripslashes($_POST[\'title\'])); ?>\');
但在前端和数据库中Custom Characters like diamond etc是stored and displayed as question mark.我已经将wordpress的tinymce编辑器集成到我的自定义插件中。我通过ajax将输入的数据保存到数据库中,如下所示:
encodeURIComponent(\'<?php echo mysql_real_escape_string(stripslashes($_POST[\'title\'])); ?>\');
但在前端和数据库中Custom Characters like diamond etc是stored and displayed as question mark.您必须对存储在UTF-8中的字符串或站点使用的任何编码进行编码。
如果你不储存有效的UTF-8,你就会得到著名的钻石。在网站上,这些不是女孩最好的朋友,他们只是破坏了你的输出。:)
看见this answer 对于一些在PHP中将文本编码为UTF-8的代码。
正在寻找一种方法,使TinyMCE编辑器始终相对于其内容,以便编辑器的高度根据其包含的文本/图像的数量而变化。TinyMCE似乎已经有了用于此的插件,但我不确定如何将其应用于Wordpress版本:http://www.tinymce.com/wiki.php/Plugin:autoresizefunction init_tinymce_autoresize($initArray){ $initArray[\'plugins\'] = \"autoresize\"; retur