Make WordPress Core


Ignore:
Timestamp:
04/02/2014 02:41:24 AM (11 years ago)
Author:
azaozz
Message:

Drag and drop files on the editor to upload: add new argument to wp_editor() to enable, fixes #27465

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r27897 r27901  
    2525    private static $has_medialib = false;
    2626    private static $editor_buttons_css = true;
     27    private static $drag_drop_upload = false;
    2728
    2829    private function __construct() {}
     
    3940     *     @type string     $default_editor    When both TinyMCE and Quicktags are used, set which
    4041     *                                         editor is shown on page load. Default empty.
     42     *     @type bool       $drag_drop_upload  Whether to enable drag & drop on the editor uploading. Default false.
     43     *                                         Requires the media modal.
    4144     *     @type string     $textarea_name     Give the textarea a unique name here. Square brackets
    4245     *                                         can be used here. Default $editor_id.
     
    6467            'media_buttons'     => true,
    6568            'default_editor'    => '',
     69            'drag_drop_upload'  => false,
    6670            'textarea_name'     => $editor_id,
    6771            'textarea_rows'     => 20,
     
    124128        $switch_class = 'html-active';
    125129        $toolbar = $buttons = $autocomplete = '';
     130
     131        if ( $set['drag_drop_upload'] ) {
     132            self::$drag_drop_upload = true;
     133        }
    126134
    127135        if ( ! empty( $set['editor_height'] ) )
     
    981989            baseURL: "<?php echo self::$baseurl; ?>",
    982990            suffix: "<?php echo $suffix; ?>",
     991            <?php
     992
     993            if ( self::$drag_drop_upload ) {
     994                echo 'dragDropUpload: true,';
     995            }
     996
     997            ?>
    983998            mceInit: <?php echo $mceInit; ?>,
    984999            qtInit: <?php echo $qtInit; ?>,
Note: See TracChangeset for help on using the changeset viewer.