【发布时间】:2017-04-03 22:25:32
【问题描述】:
我很难让微型 mce 编辑器在 wordpress 定制器中工作。
看起来只是从我的 WP_Customize_Control 扩展中调用“wp_editor”不会触发在定制器中加载 TinyMCE 脚本。
我尝试像这里的答案一样手动加载它们:https://wordpress.stackexchange.com/questions/175307/tinymce-is-not-defined-when-not-using-wp-editor
也尝试使用wp_enqueue_script('tiny-mce'),但无济于事。
这是我的渲染方法,没什么花哨的:
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php
$settings = array(
'media_buttons' => false,
'quicktags' => false,
'teeny' => true
);
wp_editor($this->value(), $this->id, $settings );
?>
</label>
<?php
}
关于如何正确执行此操作的任何建议?
【问题讨论】:
-
发现了这一点,看起来可能与定制器中的手风琴正在移动有关:core.trac.wordpress.org/ticket/19173