Kamil
asked 1 year 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 1 year 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 6 months 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 6 months 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 6 months 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 6 months ago

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

bizzwebpl
answered 6 months ago

Works as it should. Thanks!

bizzwebpl
answered 6 months 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.

DominicStaff
answered 6 months ago

Please send me the username & password of your site for further checking.

bizzwebpl
answered 6 months ago

Forgive me, but I can’t do it because the contract with the client forbids me.

Powered by DW Question & Answer Pro