• Resolved nevatonight

    (@nevatonight)


    Hello,
    Is there any option to disable text editors for vendors? (For example, in a short description of a product).
    I’ve been able to disable a visual editor by adding the following code to functions.php:

    add_filter( 'user_can_richedit' , '__return_false', 50 );

    But I can’t turn off a classic editor.

    Please tell me how I can disable the classic editor too. I don’t want users to be able to add html code and images, so I want to keep only regular text forms.

Viewing 1 replies (of 1 total)
  • Plugin Support Tanvir Hasan

    (@tanvirh)

    Hi @nevatonight

    To disable both the Visual Editor and the Classic (Text) Editor for vendors, you can use the following code snippet. This will ensure that users can only add regular text without the ability to add HTML code or images.

    Please add the following code to your functions.php file:

    add_filter('wp_editor_settings', 'disable_text_editor', 10, 2);

    function disable_text_editor($settings, $editor_id) {
    // Disable the Visual Editor (TinyMCE)
    $settings['tinymce'] = false;
    // Disable the QuickTags (Text) Editor
    $settings['quicktags'] = false;

    return $settings;
    }

    Hope this helps.

    Thanks!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.