![](/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.