Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#28440 closed enhancement (worksforme)

WP_Editor() - Disable Drag Drop Upload

Reported by: howdy_mcgee's profile Howdy_McGee Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: TinyMCE Keywords:
Focuses: ui, javascript, administration Cc:

Description (last modified by SergeyBiryukov)

This could be the same problem as my last ticket (#28338) but it seems like the drag_drop_upload flag that is currently in the codex may be broken. I've tried this on a few installs and was unable to actually disable the drag and drop upload functionality:

wp_editor($editor_content, 'editorID', array(
	'wpautop'	   => true,
	'media_buttons'	   => false,
	'textarea_name'	   => '_editor_name',
	'textarea_rows'	   => 15,
	'teeny'		   => true,
	'drag_drop_upload' => false
));

You can view The Codex here (http://codex.wordpress.org/Function_Reference/wp_editor) which is the last option in the arguments list.

Change History (4)

#1 @SergeyBiryukov
11 years ago

  • Description modified (diff)

#2 follow-up: @azaozz
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Works properly when testing on the Edit Post screen. Note: if there are several instances of TinyMCE created with wp_editor() and one sets 'drag_drop_upload' => true, it will be enabled.

#3 in reply to: ↑ 2 @Howdy_McGee
10 years ago

Replying to azaozz:

Works properly when testing on the Edit Post screen. Note: if there are several instances of TinyMCE created with wp_editor() and one sets 'drag_drop_upload' => true, it will be enabled.

I apologize I should have clarified in my original post, that is correct. Shouldn't it be on a case by case basis whether or not you allow images into the editor? For example, if I add a metabox onto a Page but don't want images to be uploaded into the content of the metabox and still allow images to be uploaded to the actual Page Content there is currently no way to disable 1 without the other. It's an all or nothing flag which seems misleading.

#4 @azaozz
10 years ago

Shouldn't it be on a case by case basis whether or not you allow images into the editor?

This actually does a "standard" uploading, same as dropping a file on the media modal or on Media Library => Add New. It is attached/active for the whole page, not possible to enable only for one instance of the editor.

If you're worried about the blue "drop-zone", that can probably be disabled on per-instance basis. However it doesn't make any difference on which editor instance a file is dropped. It will be uploaded as if dropped on the media modal.

Note: See TracTickets for help on using tickets.