为文本区域激活Wordpress TinyMCE编辑器


Activating Wordpress TinyMCE editor for a text area

我正在尝试为文本区域激活TinyMCE。我的代码低于

<?php
wp_editor( '', 'content-id', array( 'textarea_name' => 'txtmessage', 'media_buttons' => false, 'tinymce_adv' => array( 'width' => '300', 'theme_advanced_buttons1' => 'formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,spellchecker,wp_fullscreen,wp_adv' ) ) ); 
echo "'r'n";
echo "'r'n";
echo "'r'n --------Original Message-------- 'r'n 'r'n";
echo "'r'n'r'n".$reply_message_contentmain;

代码有效。然而,我的问题是,回声消息显示在TinyMCE区域的底部和外部。有什么建议吗,怎么修?我不是php专家。谢谢,

wp_editor()上的语法为:

<?php wp_editor( $content, $editor_id, $settings = array() ); ?> 

您已将$content留空,并在编辑呼叫后回复。。。。所以做一些类似的事情:

$content = ''r'n'r'n'r'n--------Original Message-------- 'r'n'r'n'r'n' .$reply_message_contentmain
wp_editor( $content, 'content-id', array( 'textarea_name' => 'txtmessage', 'media_buttons' => false, 'tinymce_adv' => array( 'width' => '300', 'theme_advanced_buttons1' => 'formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,spellchecker,wp_fullscreen,wp_adv' ) ) );

这应该有效,但我目前无法测试,请告诉我你的进展(但这应该会让你走上正轨)