Chandra Dev Borah
asked 8 years ago

Hello All,

I have trying to remove these two options insert link and remove links from front end Tinymce editor in the DW plugin of my website. I have tried using the answer given in this link : https://www.designwall.com/question/tinymce-visual-editor-in-frontend-is-different-from-backend/
in my child theme, but somehow it doesnot change in the front end. However, it make changes accordingly in the backend of my site. I don’t want to edit the parent theme for that. Please provide me some other ways to resolve it.

And thanks for the wonderful plugin.

4 Answers
Kevin
answered 8 years ago

Hi Chandra Dev Borah,

You can use the add_filter to dwqa_tinymce_toolbar1 (This filter is only available since DWQA 1.3.6). Please open functions.php file in the child-theme folder then add the following code:

add_filter( 'dwqa_tinymce_toolbar1', 'dwqa_disable_tinymce_options' );
function dwqa_disable_tinymce_options( $button ) {
       return 'bold,italic,underline,|,'.'bullist,numlist,blockquote,|,'.'image,code,|,'.'spellchecker,fullscreen,dwqaCodeEmbed,|,';
}

View more in /plugins/dw-question-answer/inc/Editor.php line 56.

borah
replied 8 years ago

It works perfectly. Thank You so much !!

Angelos Kyritsis
answered 8 years ago

Kevin, this is an excellent solution.

Chandra, you can also use this code if you want to select different buttons for the site administrators and for the plain users.

add_filter( 'dwqa_tinymce_toolbar1', 'dwqa_disable_tinymce_options' );
function dwqa_disable_tinymce_options( $button ) {

if ( current_user_can('manage_options') )
{ return 'link,unlink';
} else {
       return 'spellchecker';
       }
}

With the above quote, only the website administrators see the buttons to add and remove links, and the plain users only get a spellchecker.

borah
replied 8 years ago

@Kevin Thank you so much for the quick reply, it works perfect now. Its a wonderful plugin.
@Angelos Thank you so much to you also for the reply. Yes i also will try your quote.

Thanks to both of you !!

Catherine Mollet
answered 8 years ago

Great! Thanks a lot for this tip. But how is it possible to disable the code editor (like in this forum)?

Dominic Staff
replied 8 years ago

You can add the following code to the style.css file:
.wp-switch-editor { display: none; }

thinhmmt
answered 5 years ago

Sorry for the inconvenience, i’m setting my QA page and i don’t wan’t user post url in the text area, so i’m looking and see this post but this solution can’t slove my problem if i copy and paste url to text area. Can you help me. Thank verry much

Dominic Staff
replied 5 years ago

Please send me your site URL for further checking.

Powered by DW Question & Answer Pro