Make WordPress Core


Ignore:
Timestamp:
03/15/2012 04:14:05 AM (13 years ago)
Author:
koopersmith
Message:

Theme Customizer: First pass for upload controls, using background image as an example. Add a wrapper for Plupload that allows for custom upload UIs. see #19910.

wp.Uploader is a wrapper that provides a simple way to upload an attachment (using the wp_ajax_upload_attachment handler). It is intentionally decoupled from the UI. When an upload succeeds, it will receive the attachment information (id, url, meta, etc) as a JSON response. If the upload fails, the wrapper handles both WordPress and plupload errors through a single handler.

As todos, we should add drag classes for the uploader dropzone and account for the rough 100mb filesize limit in most browsers. The UI for the customizer upload controls could be improved as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r20133 r20179  
    229229    $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
    230230
     231    $scripts->add( 'wp-plupload', "/wp-includes/js/plupload/wp-plupload$suffix.js", array('plupload-all', 'jquery', 'json2') );
     232    $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );
     233
    231234    // keep 'swfupload' for back-compat.
    232235    $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113');
Note: See TracChangeset for help on using the changeset viewer.