Kamil
asked 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago

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

bizzwebpl
answered 2 years ago

Works as it should. Thanks!

bizzwebpl
answered 2 years 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 1 year ago

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

bizzwebpl
answered 1 year ago

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

Powered by DW Question & Answer Pro