我使用从WP编辑器中删除了选项卡
wp_editor(\'\', \'some-id\', array(\'quicktags\' => false) );
但有时,当页面加载TinyMCE字段时,选中文本选项卡:而不是HTML选项卡:
JS/JQuery是否有办法确保选项卡始终是visualHTML选项卡?
已尝试:
add_filter( \'wp_default_editor\', create_function(\'\', \'return "tinymce";\') );
我使用从WP编辑器中删除了选项卡
wp_editor(\'\', \'some-id\', array(\'quicktags\' => false) );
但有时,当页面加载TinyMCE字段时,选中文本选项卡:而不是HTML选项卡:
JS/JQuery是否有办法确保选项卡始终是visualHTML选项卡?
已尝试:
add_filter( \'wp_default_editor\', create_function(\'\', \'return "tinymce";\') );
我的解决方案。我发现问题是JS WP设置。需要刷新页面以使编辑器使用新设置进行初始化
<script>
if (getUserSetting(\'editor\') != "tinymce") {
setUserSetting(\'editor\', \'tinymce\');
location.reload();
}
</script>
我看到这一页--http://wp-snippets.com/set-default-editor/ * -- 这看起来很有希望,虽然有点过时。我建议您尝试以下方法,而不是使用他们的代码:
add_filter( \'wp_default_editor\', \'wpse101200_default_editor\' );
function wpse101200_default_editor( $editor ) {
return \'tinymce\';
}
参考WPSeekwp_default_editor()
页码wp_default_editor()
在WordPress核心源中不幸的是,法典目前没有wp_default_editor()
页
__显然你也是。我第一次读到你的问题时就错过了。
有办法打电话吗wp_editor 对于只使用文本/HTML模式而不使用TinyMCE的元框。我认为不推荐使用的函数pre-3.3做到了这一点,但我不确定它现在是如何做到的。