0

If I use this php code to display a Tiny MCE Editor in my bbPress forum (front end):

//editor bbpress
function bsp_enable_visual_editor( $args = array() ) {
    global $bsp_style_settings_form ;
    $args['tinymce'] = true;
    if ($bsp_style_settings_form['Show_editorsactivate'] == 1)  $args['quicktags'] = false;
    return $args;
}

It looks like this:

Sample

Notice that it has a Insert Image button?

Now, if I change code by inserting a single line, like this:

//editor bbpress
function bsp_enable_visual_editor( $args = array() ) {
    global $bsp_style_settings_form ;
    $args['tinymce'] = true;
    $args['teeny'] = false;
    if ($bsp_style_settings_form['Show_editorsactivate'] == 1)  $args['quicktags'] = false;
    return $args;
}

I introduced the $args['teeny'] = false; line so now I get this tool bar:

Sample

I prefer this toolbar because it provides extra buttons. However:

  1. I want to remove the Insert Read More button.
  2. I want to replace that button with the previous Insert Image button.

I don't know how to do this.

I came across this but don't know how to implement it (if indeed it is the right approach).

Update

If I use this snippet instead:

add_filter("mce_buttons", "tinymce_editor_buttons", 99); //targets the first line
​
function tinymce_editor_buttons($buttons) {
return array(
  "formatselect", 
  "bold",
  "italic",
  "underline",
  "bullist",
  "numlist",
  "blockquote",
  "justifyleft",
  "justifycenter",
  "justifyright",
  "code",
  "link",
  "unlink",
  "image",
  "wp_adv"
  //add more here...
  );
}

It looks like this:

enter image description here

I don’t understand why the align left, right, Center and code buttons won’t show?

Update 2

I needed to use:

  • alignleft
  • aligncenter
  • alignright

But I still can’t get the code button showing. I have tried:

  • code
  • code-sample

I think I have been confusing myself.

  1. The code button needs a plugin installed from what I have read.
  2. This plugin is for viewing source and not for wrapping the text in the topic with code tags.

I think we are OK. :)

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.