Marc Blase

Add button to WordPress editor ~ TinyMCE

Don’t know why I’ve never done this before, but it’s quite simple. And makes it easier for users to add items in the visual editor, instead of [*gasp*] the text editor.

function enable_more_buttons($buttons) {
  $buttons[] = 'hr';
  // Repeat with any other buttons you want to add, e.g.
  // $buttons[] = 'fontselect';
  // $buttons[] = 'sup';
  return $buttons;
}
add_filter("mce_buttons", "enable_more_buttons");

For more info here’s the article at WordPress Codex.

Published on April 29, 2013