[wp-trac] [WordPress Trac] #21483: Refactor Customizer Upload, Image, and Background Image controls to leverage the media library/modal

WordPress Trac noreply at wordpress.org
Tue Oct 28 05:10:14 UTC 2014


#21483: Refactor Customizer Upload, Image, and Background Image controls to
leverage the media library/modal
-------------------------------------------------+-------------------------
 Reporter:  jjonesftw                            |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  4.1
Component:  Customize                            |     Version:  3.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:  ui,
  feedback ui-feedback ux-feedback               |  javascript
-------------------------------------------------+-------------------------
Changes (by celloexpressions):

 * keywords:  has-patch needs-testing => has-patch needs-testing dev-
     feedback ui-feedback ux-feedback


Comment:

 This now works pretty well, and the new JS templating API lends itself
 especially well to this. The slightly modified media code allows us to
 offer some visual preview/feedback for all file types, basically for free.
 It's time for UX, dev, and UI feedback - please test the patch, review the
 code, evaluate the new workflows, consider back-compat, etc. Patch
 iterations are welcomed.

 Known issues with [attachment:21483.2.diff]:
 - Need to address handling of the default setting value. Would probably be
 a "default" link in place of remove, then switching to remove when the
 default is being used. But we can't easily preview the defaults,
 unfortunately, as they aren't usually attachments, so we'll probably
 implement that for images only.
 - The labels need to be translated, but PHP doesn't seem to like doing
 that the way I've implemented it. How can we do that, keeping in mind that
 the labels should be able to be overridden as easily as possible.
 - Audio and video previewing basically work (yay), but there seems to be
 something missing that actually initializes MediaElement.js once the
 elements show up in the DOM. Perhaps @wonderboymusic has thoughts?
 - Should there be some sort of core refresh/reRender functionality, or is
 it best to leave it to specific controls? How's the implementation here
 @westonruter?
 - Back-compat: the background image control is left unchanged to
 demonstrate that subclasses of `WP_Customize_Image_Control` (and by
 extension `WP_Customize_Upload_Control`) generally don't experience
 significant breakage - we'll truncate it like `WP_Customize_Image_Control`
 once it's looking good.
 - This does deprecate some things and quietly ignore some things (like
 `WP_Customize_Upload_Control::$extensions`). The upside clearly outweighs
 those here, but are there any particular things that we could do to make
 the transition smoother?
 - Could use some accessibility feedback on this. I did a quick keyboard
 accessibility check, and while the media modal part is just as bad as it
 is everywhere else in core, it is functional. Needs screenreader testing
 for sure, and not sure how the `<label>` should be placed.
 - Could probably have more structured inline docs, but not sure exactly
 what's needed, @DrewAPicture?
 - For backgrounds, will we want to keep the concept of previously-uploaded
 backgrounds, like headers have? That would introduce more complexity, so
 we might want to wait until we do things like adding support for multiple
 (or randomized) backgrounds.

 General note: we'll be able to close a bunch of tickets once this gets in,
 since bugs ranging from no error messages to favicon uploads failing no
 longer exist.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21483#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list