Disable TinyMCE Drag and Drop

I would very much like to disable the drag and drop upload feature for tinyMCE (both the default one and the wp_editor() one) because it interacts with my custom pop up menus - (WP Trac). Right now I'm trying to just disable the one with the actual WP_Editor() function. For some reason it doesn't seem to actually disable any drag and drop functionality and was wondering if I was doing something wrong. My function call looks like this:

wp_editor($meta_content, 'additionalTab', array(
    'wpautop'           =  true,
    'media_buttons'     =  false,
    'textarea_name'     =  '_additional_content',
    'textarea_rows'     =  15,
    'teeny'             =  true,
    'drag_drop_upload'  =  false
));

The Expected Output is that it should completely disable drag and drop uploads directly to the tinyMCE.

The Actual Output is that it doesn't do anything, it still allows you to drag and drop upload into the tinymce. Is there something wrong with what I'm doing or is there something inherieitnly wrong with wp_editor()?

Topic drag-drop wp-editor uploads tinymce media Wordpress

Category Web


you can solve this problem by enqueue the following script with the dependency of jQuery

 jQuery(document).ready(function(){
      tinyMCEPreInit.dragDropUpload = false;
 });

To add the dependency you can refer this link

I have tested this solution and it has worked for me. I hope it will work for you too.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.