Please or Register to create posts and topics.

message editor icons/buttons

Page 1 of 2Next

The last icon on the message editor toolbar has a tool tip of “insert/edit image(Shift+Alt+M)”.

On my forum I have disabled uploads it doesn’t make sense (to me) to be able to ‘insert/edit image’ when uploads are disabled. Also the dialog box that  pops up on clicking the button is lacking in usability instructions. I have worked it out but my forum users are just confused. So I need it to be able to remove it and I can’t find CSS code that I think will work consistently on the toolbar.

It does not appear on my editor toolbar at other places eg add new post.

I have installed WPedit plugin and it is not listed on its toolbars so i can’t remove it there, But I do see it is a ‘standard WP’ button I can add to my toolbar using WPedit and it does get added so WPedit is working just fine. Therefore it appears to me to be something you have added.

Suggestions?

Thanks

 

Hello @ray

This button can be used to include images inside of posts via their links. Users cannot use this functionality for uploading any files/images.

Currently there is no filter available to remove this button but if you are fine with editing a core-file you can have a look into the following file:

  • asgaros-forum/includes/forum-editor.php
  • Around line 19 you will find: $buttons[] = ‘image’;
  • Replace it with: //$buttons[] = ‘image’;
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

ok I can do that.

i’ll just have to remember to check and do ait again as appropriate as updates are release.  I usually deploy updates to my development site before my production site so that should be ok.

thanks

Hello again @ray

The next version will come with a new filter called asgarosforum_filter_editor_buttons. You can use this filter to modify the editor buttons used inside the forum editor, for example in your case:

function remove_img_button($buttons) {
  // Remove the read-more button.
  $searchKey = array_search('image', $buttons);

  if ($searchKey !== false) {
    unset($buttons[$searchKey]);
  }
  
  return $buttons;
}
add_filter('asgarosforum_filter_editor_buttons', 'remove_img_button');

You can find the changeset here:

https://github.com/Asgaros/asgaros-forum/commit/bbb160b9a2b6d7e59265751fc4af6345c207590c

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hi Thomas

Thank you very much

 

 

Hello! Thanks a lot for the plugin! Tell me how to delete a few buttons?

Hello @ivan

If you want to remove multiple buttons of the editor and dont have coding-experience, I recommend you to use a plugin like the following:

TinyMCE Advanced

With this extension you can fully customize the WordPress editor and its functionality (buttons).

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
Quote from Asgaros on February 6, 2019, 8:59 pm

Hello @ivan

If you want to remove multiple buttons of the editor and dont have coding-experience, I recommend you to use a plugin like the following:

TinyMCE Advanced

With this extension you can fully customize the WordPress editor and its functionality (buttons).

Thanks for the quick response! Could you tell me how to do this with functions.php

So it will be right?

function remove_img_button($buttons) {
  // Remove the read-more button.
  $searchKey = array_search('image', $buttons);
  if ($searchKey !== false) {
    unset($buttons[$searchKey]);
  }

  $searchKey = array_search('fullscreen', $buttons);
  if ($searchKey !== false) {
    unset($buttons[$searchKey]);
  }
  $searchKey = array_search('link', $buttons);
  if ($searchKey !== false) {
    unset($buttons[$searchKey]);
  }
  
  return $buttons;
}
add_filter('asgarosforum_filter_editor_buttons', 'remove_img_button');

Or you can make it easier?

Hello @ivan

Sorry for the late reply! Yes, your code looks fine.

Just add it to the end (before the closing ?> tag if there is one) of your themes functions.php file.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
Page 1 of 2Next