如何将自定义按钮添加到 ACF Wysiwyg tinymce?
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 所见即所得工具栏的初始化忽略了 tinymce 插件的加载
这段代码解决了问题:
add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars' );
function my_toolbars( $toolbars )
{
return array();
}
所有插件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 所见即所得工具栏的初始化忽略了 tinymce 插件的加载
这段代码解决了问题:
add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars' );
function my_toolbars( $toolbars )
{
return array();
}
所有插件tinymce正常工作