[wp-trac] [WordPress Trac] #32417: Add new core media widget

WordPress Trac noreply at wordpress.org
Thu Feb 23 04:57:42 UTC 2017


#32417: Add new core media widget
-------------------------------------------------+-------------------------
 Reporter:  melchoyce                            |       Owner:  melchoyce
     Type:  feature request                      |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.8
Component:  Widgets                              |     Version:  4.3
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests has-patch needs-    |     Focuses:  ui,
  refresh                                        |  administration
-------------------------------------------------+-------------------------

Comment (by celloexpressions):

 I made a few fixes on GitHub, along with some technical review comments.
 Here are a few usability questions I have/things I didn't want to change
 in the patch yet:
 - Most default themes (and as a result, likely other themes) that
 implement custom styles for the MediaElement players scope their CSS to
 `.hentry` to have higher specificity than the MediaElement styling
 provided by WordPress. This custom styling needs to apply to widgets too,
 ideally without making theme changes. This is a blocker for shipping I
 think, and if theme changes are required I'm not sure that we should
 release this feature in a minor release (unless theme outreach happens for
 a period of time prior). There are a few options here:
 1. Add a `.hentry` class to the media widget container for all of them.
 Not semantic with the intent of that class and might risk causing other
 issues if themes use that class for other styling.
 2. Finally fix the core-provided and default MediaElement styles to load
 before theme styles or somehow have lower specificity so that a container
 isn't needed. However, themes that scope to `.hentry` would still need to
 be updated to removed that.
 3. Update all bundled themes' CSS for custom MediaElement styles (may
 include color schemes in some cases) to also style media widgets. Start
 substantial theme developer outreach regarding this requirement (I know
 I've done this in several themes, there are likely many others).
 Unfortunately, this is something that was a pretty bad idea in terms of
 how themes should have done things, but this is the route that bundled
 themes suggested around the time that Audio and Video support were added
 to core.
 - Not all bundled themes have the above issue; I quickly found these:
 https://github.com/WordPress/WordPress/blob/master/wp-
 content/themes/twentyfourteen/style.css#L1348,
 https://github.com/WordPress/WordPress/blob/master/wp-
 content/themes/twentythirteen/style.css#L1229,
 https://github.com/WordPress/WordPress/blob/master/wp-
 content/themes/twentyseventeen/style.css#L2801.
 - There is partial, broken support for file types other than images,
 audio, and video. I'd suggest falling back to an assumed type of
 "document", linking the title to the media file (and using the file name
 if the title is blank). For PDFs we should also be able to show a
 thumbnail and link that with the title/filename being optional, for sites
 that support PDF thumbnails as of 4.7. I would guess that PDFs would be
 used more than video here, even, so we should support that since we can
 fairly easily. If nothing else we need to show an error message if we
 don't/can't support a particular file type at all.
 - FYI I added an icon and updated the widget description to better align
 with other core widgets - see screenshot. The menu widget is an exception
 here, as well as with its naming, apparently. We might want to fix that
 while we're at it.
 - Do we need the text "Add an image, video, or audio to your sidebar." in
 the actual widget controls? That seems redundant and works against `Strive
 for Simplicity`.
 - Seeing as we have clickable placeholders, and #34323 is still
 unresolved, we need an accessibility review still, cc @afercia. (for what
 it's worth I think the approach for clickable placeholders here is
 appropriate for all users)

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


More information about the wp-trac mailing list