2016-08-24 65 views
0

我想在我的WordPress插件中使用TinyMCE。我想爲我的自定義文本框和文本區域添加TinyMCE編輯器。在WordPress管理頁面加載Tinymce腳本

我試過在下面的代碼中加載TinyMCE編輯器腳本。 wp_enqueue_script('tiny_mce');

但是這不會在我的管理頁面加載TinyMCE編輯器。當我啓動TinyMCE時,由於沒有定義TinyMCE,它給了我錯誤。

任何人都可以在這裏知道如何在我的管理頁面上加載TinyMCE腳本嗎?

回答

1

WordPress默認wp_editor()函數以頁面和頁面中使用的典型方式在頁面中呈現編輯器。

您可以使用它像

$content = ''; // Initial content for the editor 
$editor_id = 'editor_id'; //HTML id attribute value for the textarea and TinyMCE 
wp_editor($content, $editor_id); 

check here

+0

感謝維迪亞。它像一個魅力。 – patilvikasj

+0

不客氣 –