1

我正在尝试为文本区域激活 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专家。谢谢,

4

1 回答 1

3

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' ) ) );

这应该可行,但我目前无法从我所在的位置对其进行测试,让我知道你的进展情况(但这应该让你走上正轨)

于 2012-09-10T04:10:02.570 回答