Kamil
asked 10 months ago

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 🙂

5 Answers
DominicStaff
answered 9 months ago

At the moment, you can go to the Dashboard > Questions > Settings > General setting then enable the Markdown Editor option. 
Hope this helps.

bizzwebpl
answered 1 week ago

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.

DominicStaff
answered 1 week ago

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; }
The Enforcer
answered 1 week ago

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; }

 

Dominic Staff
replied 1 week ago

Yes, you can use the CSS code or the code that I have provided in previous answer.

bizzwebpl
answered 7 days ago

Works as it should. Thanks!

bizzwebpl
answered 2 days ago

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.

Powered by DW Question & Answer Pro