0
我使用以下代碼創建可重複元框。我如何在這個textarea字段中添加一個wysiwyg編輯器。任何幫助是非常讚賞在WordPress textarea Meta Box中添加wysiwyg編輯器
How to create meta box using clone ajax and jquery in wordpress
感謝
我使用以下代碼創建可重複元框。我如何在這個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 –