Hello,
I’m using DW Question & Answer plugin and I don’t really need a WYSIWYG editor. Is it possible to remove the TinyMCE editor and use a normal textarea instead of it?
Thanks for your assistance 🙂
At the moment, you can go to the Dashboard > Questions > Settings > General setting then enable the Markdown Editor option.
Hope this helps.
Hi, I will start the topic again. Unfortunately for me there is no such thing as “Dashboard> Questions> Settings> General setting then enable the Markdown Editor option”. And I need to completely disable TinyMCE and settle the textarea itself.
You can add the following code to the functions.php file:
function disable_visual_editor($can)
{
global $post;
$post_type = get_post_type($post);
if ($post_type == 'dwqa-question') {
return false;
}
return $can;
}
add_filter('user_can_richedit', 'disable_visual_editor');
Then add the following code to the style.css file:
.quicktags-toolbar { display: none; }
I use this:
.submit-dwqa-question .wp-editor-tools, .submit-dwqa-question .mce-top-part, .single-dwqa-question .wp-editor-tools, .single-dwqa-question .mce-top-part { display: none !important; } .submit-dwqa-question .wp-editor-tools, .submit-dwqa-question .mce-statusbar, .single-dwqa-question .wp-editor-tools, .single-dwqa-question .mce-statusbar { border: 0 !important; } .submit-dwqa-question .wp-editor-tools, .submit-dwqa-question .mce-path-item .mce-last, .single-dwqa-question .wp-editor-tools, .single-dwqa-question .mce-path-item .mce-last { display: none !important; }
Yes, you can use the CSS code or the code that I have provided in previous answer.
Works as it should. Thanks!
OK, now I still need to remove the visual editor on the question page.
Can it be done with a similar code?
function disable_visual_editor ($ can)
{
global $ post;
$ post_type = get_post_type ($ post);
if ($ post_type == 'dwqa-question') {
return false;
}
return $ can;
}
add_filter ('user_can_richedit', 'disable_visual_editor');
Unfortunately, the code The Enforcer gave did not work, that is, it works, but after clicking “Add question” in the forum saves only the topic itself, and the content of the question is empty.
Please send me the username & password of your site for further checking.
Forgive me, but I can’t do it because the contract with the client forbids me.
Please login or Register to submit your answer