How to add custom button in ACF Wysiwyg tinymce?


PHP work

I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code:

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('')
        }
    } );
} );

It works great for the standard Wordpress tinymce editor. But not for ACF Wysiwyg tinymce.

PHP work

The initialization of the ACF Wysiwyg toolbar ignores the loading of the tinymce plugin.
This code solves the problem:

add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars'  );
function my_toolbars( $toolbars )
{
    return array();
}

All plugins tinymce work fine

Related


How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

Add custom icon to tinyMCE button

captiz I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not acceptable,

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

How to add custom block in tinyMce

Tariq Hussein I want to add a custom format block for TinyMCE, I was able to do it using the following code. style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] https://codepen.io/anon/pen/vWRGEg However, by adding this code,

How to add custom block in tinyMce

Tariq Hussein I want to add a custom format block for TinyMCE, I was able to do it using the following code. style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] https://codepen.io/anon/pen/vWRGEg However, by adding this code,

How to add custom bullets to tinyMCE?

Ennio I would like to add some extra options to the bullet dropdown in tinyMCE, is this possible? I would like to add ►Bullet type and different color options. (red, blue, etc...) username Yes. In the tinyMCE configuration you need to specify: style_formats: [

How to add custom bullets to tinyMCE?

Ennio I would like to add some extra options to the bullet dropdown in tinyMCE, is this possible? I would like to add ►Bullet type and different color options. (red, blue, etc...) username Yes. In the tinyMCE configuration you need to specify: style_formats: [

How to add custom bullets to tinyMCE?

Ennio I would like to add some extra options to the bullet dropdown in tinyMCE, is this possible? I would like to add ►Bullet type and different color options. (red, blue, etc...) username yes. In the tinyMCE configuration you need to specify: style_formats: [