Wordpress:微小的编辑器不存储数据

时间:2012-09-26 08:47:37

标签: wordpress tinymce

我正在尝试在我的主题选项中保存来自微小编辑器的数据,但它没有保存。这是我的完整案例

case 'tiny':

    $tinysettings = array(
        'editor_class' => 'theme_editor',
        'tinymce' => array(
            'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,link,unlink,anchor,|,blockquote',
            'theme_advanced_buttons2' => 'formatselect,forecolor,|,image,|,sub,sup',
            'theme_advanced_buttons3' => '',
            'theme_advanced_buttons4' => '',
            'width' => '450',
            'height' => '200',
        ),
    );

?>

    <div class="options_input options_textarea">
        <div class="options_desc"><?php echo $value['desc']; ?></div>
        <span class="labels"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></span>

        <div class="tiny-editor">
            <?php wp_editor( '', $value['id'], $tinysettings ); ?>
        </div>
    </div>
<?php
break;

1 个答案:

答案 0 :(得分:0)

<?php wp_editor( '', $value['id'], $tinysettings ); ?>

第一个参数是编辑器的实际内容,但您将其设置为空字符串。 如果将内容保存在名为$ content的变量中,则可以使用:

<?php wp_editor( $content, $value['id'], $tinysettings ); ?>