![](/img/trans.png)
[英]Wordpress - How to add advanced TinyMCE WYSIWYG editor to a textarea box in custom page, not meta box
[英]How add custom button to ACF Wysiwyg tinymce?
我需要将自定义按钮添加到工具栏 ACF Wysiwyg tinymce。 我使用此代码:
tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) {
editor.addButton( 'wdd_mce_format', {
active: true,
tooltip: 'Formating the List',
text : 'Formating the List',
icon : false,
type : 'button',
onclick : function () {
do_stuff_here('')
}
} );
} );
它适用于标准的 Wordpress tinymce 编辑器。 但不适用于 ACF Wysiwyg tinymce。
ACF Wysiwyg 工具栏的初始化忽略 tinymce 插件的加载
这段代码解决了这个问题:
add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars' );
function my_toolbars( $toolbars )
{
return array();
}
所有插件tinymce正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.