在WordPress textarea Meta Box中添加wysiwyg编辑器
问题描述:
我使用以下代码创建可重复元框。我如何在这个textarea字段中添加一个wysiwyg编辑器。任何帮助是非常赞赏在WordPress textarea Meta Box中添加wysiwyg编辑器
How to create meta box using clone ajax and jquery in wordpress
感谢
答
类 'theEditor' 添加到您的文字区域。
<textarea class=”theEditor” name=’blurb’ id=’blurb’></textarea>
编辑:
你也可以用JS
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#blurb").addClass("mceEditor");
if (typeof(tinyMCE) == "object" &&
typeof(tinyMCE.execCommand) == "function") {
tinyMCE.execCommand("mceAddControl", false, "blurb");
}
});
</script>
<textarea class="" name='blurb' id='blurb'></textarea>
答
也许你正在使用TinyMCE的较新版本中添加编辑器。变化
tinyMCE.execCommand("mceAddControl", false, "blurb");
与
tinyMCE.execCommand("mceAddEditor", false, "blurb");
你需要使用''“''不''”''或''”'' – jmattheis
不工作!@parthmahida –
我已经更新了答案@robertchan –