0

I have added tinymce to a plugin using this code

$settings = array(
  'text_area_name'=>'the_data',
  'tinymce' => true,
  'media_buttons' => false,
);
wp_editor($initial_data, $id, $settings); 

It works as expected producing this

enter image description here

I would like to edit the toolbars adding and removing tools, forcing the initially closed tool bar open, etc. Doing a search there are resources dating back 10 years and others related to ajax, but I can't seem to find anything for this situation.

I have tried various methods in the array, but none have worked so far.

1 Answer 1

1

Try this and adjust the tools as you wish:

$settings = array(
  'text_area_name'=> 'the_data',
  'textarea_rows' => 27,
  'teeny'         => false,
  'media_buttons' => true,
  'quicktags'     => true,
  'tinymce'       => array ( 
    'paste_as_text' => true,
    'toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright',
    'toolbar2' => 'strikethrough, forecolor, pastetext, removeformat, charmap, link, unlink, redo, undo, wp_help, styleselect',
    'plugins' => 'charmap, colorpicker, hr, lists, media, paste, tabfocus, textcolor, fullscreen, wordpress, wpautoresize, wpeditimage, wpemoji, wpgallery, wplink, wpdialogs, wptextpattern, wpview'
    ),
);
wp_editor($initial_data, $id, $settings);
1
  • Yes, I actually discovered this but had forgotten I had asked the question. I'll give you credit for the answer as it might help someone else.
    – Steve
    Commented Nov 15, 2023 at 23:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.