How to increase visual editor buttons in wordpress


The visual editor in default mode only displays a few buttons. In some cases, you may need other buttons to help you coordinate and do not find them, so you have to install an addition to the advanced visual editor. But today I found a solution that enables us to add buttons without using any addition, just inserting a simple code in the properties file of the templateSome buttons need their own formatting from the template used for this please set them in the template format file style.css

The way to add these buttons is very easy, just open the properties file (functions.php) and add the following function:

function enable_more_buttons($buttons) {
  $buttons[] = "hr";
  $buttons[] = "sub";
  $buttons[] = "sup";
  $buttons[] = "fontselect";
  $buttons[] = "fontsizeselect";
  $buttons[] = "styleselect";
  return $buttons;
}
add_filter("mce_buttons_3", "enable_more_buttons");

The result will be as follows:

visual editor wp - wordpress magazine

Here we have to add buttons to the quality of the font and font, formatting size etc and you can also add more buttons using the following list of the site tinymce select any button down the variables in the function Nakhadd and add an example of this button cleanup

function enable_more_buttons($buttons) {
 $buttons[] = "hr";
 $buttons[] = "sub";
 $buttons[] = "sup";
 $buttons[] = "fontselect";
 $buttons[] = "fontsizeselect";
 $buttons[] = "styleselect";
 /** This is how we add the code */
 $buttons[] = "cleanup";
 return $buttons;
}
add_filter("mce_buttons_3", "enable_more_buttons");

Some buttons from the tinymce website need special additions, see the website’s documentation to learn more

Add the visual editor TinyMCE Advanced

TinyMCE Advanced WordPress Plugins - WordPress Magazine

You can also use the TinyMCE Advanced plugin. It has many buttons that you may also need on the TinyMCE Advanced plugin page on the WordPress site.

Most importantly, I hope you will benefit from this method

If you have any questions, please leave a comment and don’t forget to subscribe to our mailing list. Thank you very much

Peace, mercy and blessings of God

Leave a Comment