0

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

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;
4

1 回答 1

0

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

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

<?php wp_editor( $content, $value['id'], $tinysettings ); ?>
于 2016-12-30T17:37:51.333 回答