When a theme supports HTML5 captions via add_theme_support( 'html5', 'caption' ), figure and figcaption will be used instead of div and p.
There's a bonus. But first, some history: Captions were introduced with an inline style set for the container. This remains, as it is there to force captions to wrap. But this inline style included an extra 10 pixels, which have vexxed theme developers for years. While these pixels were designed to ensure padding around floated images, modern themes handle this with grace. The additional pixels thus feel encumbering.
As the new HTML5 gallery support avoids outputting default gallery styles (again, irking theme developers for years; see #26697), the new HTML5 caption support will also ditch these 10 pixels of unwanted hand-holding.
The 10 pixels are also removed entirely in the visual editor (and more styles may also disappear here; see #26642), giving themes the power necessary to match the frontend styles.
The filter img_caption_shortcode_width added in 3.7 to work around this madness (see #14380) is skipped entirely when the theme supports HTML5 captions.
props obenland, azaozz.
see #26642. also fixes#9066.
Built from https://develop.svn.wordpress.org/trunk@27668
git-svn-id: http://core.svn.wordpress.org/trunk@27511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Abstract the setting of a primary button and its callback in `wp.media.view.MediaFrame.MediaDetails`
* Account for the existence or non-existence of `$content_width` in the TinyMCE views for video
* Make sure video models always have dimensions, even if they are the defaults
* For browsers that are not Firefox, don't use a timeout when setting the `MediaElementPlayer` instance in TinyMCE views
See #27320.
Built from https://develop.svn.wordpress.org/trunk@27655
git-svn-id: http://core.svn.wordpress.org/trunk@27498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Move `WidgetCustomizerPreview` to `wp.customize.WidgetCustomizerPreview`
* Move `WidgetCustomizerPreview_exports` to export_preview_data()
* Use `_wpWidgetCustomizerPreviewSettings` to transfer settings to `wp.customize.WidgetCustomizerPreview`
see #27485.
Built from https://develop.svn.wordpress.org/trunk@27653
git-svn-id: http://core.svn.wordpress.org/trunk@27496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Support a `caption` attribute for audio and video shortcodes
* In `wp.media.audio|video`, rename `update` to `shortcode` to allow these models to share the same mixins as `wp.media.collection` subclasses
* When sending an audio or video shortcode to the editor, create a default caption if the user hasn't entered one. This currently only displays in the editor, not on the front end. Captions aren't tied to a specific attachment here because external sources are supported.
* In the `wp.mce.media` mixin, in the `edit` method, read `attr` instead of `data` when attempting to parse the encoded shortcode. `data` does not automatically update when the attribute changes. This was a blessing to debug.
* Add `wp.mce.media.PlaylistView` to support playlist views in TinyMCE
* Expose `WPPlaylistView` to global scope and suppress auto-parsing of playlist nodes when in the admin. Allow `WPPlaylistView` to be passed `metadata` on creation instead of requiring a JSON blob to be parsed.
* Remove all of the playlist logic from the `wpgallery` TinyMCE plugin.
* In `wp_prepare_attachment_for_js()` return more data for audio/video so that playlists can have parity in the admin/front end.
See #27320.
Built from https://develop.svn.wordpress.org/trunk@27640
git-svn-id: http://core.svn.wordpress.org/trunk@27483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Remove the audio/video shortcode parsing from the `wpgallery` plugin.
* Make `mce-view` a dependency of `media-audiovideo`
* Introduce `wp.mce.video`, `wp.mce.audio`, `wp.mce.media`, and `wp.mce.media.View`
* Rename `wp.media.audio|video.shortcode()` to `wp.media.audio|video.update()` since it is called on Update and returns a `wp.shortcode` object now.
* In `wp.mce.View.render()`, fire a `ready` event when the placeholder is being parsed and pass the current node to the event handler.
See #27389, #27437.
Built from https://develop.svn.wordpress.org/trunk@27615
git-svn-id: http://core.svn.wordpress.org/trunk@27458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
UX Changes:
* Don't add a menu item for "Add Audio|Video Source"
* In the Audio|Video Details modal, add buttons and some suggestive text for adding alternate playback sources
* Don't show "Create Audio|Video Playlist" menu items until the user has uploaded audio or video files
See #27437.
Built from https://develop.svn.wordpress.org/trunk@27608
git-svn-id: http://core.svn.wordpress.org/trunk@27451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Makes sure that the editor is focused when clicking on a wpview.
- When a view is the first or last node in the editor and a click on the area around the view adds a new paragraph, deselect the wpview so that the new paragraph is properly focused.
- When navigating via keyboard, select or deselect wpviews as appropriate.
Props gcorne, see #26959
Built from https://develop.svn.wordpress.org/trunk@27582
git-svn-id: http://core.svn.wordpress.org/trunk@27425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Update the styling of the image caption and gallery toolbars.
- Fix issue where the hidden clipboard div in wpView.
- Switch to using the pencil dashicon for Edit.
- Add `max-width: 100%;` to images in the gallery preview and adjust column widths.
Props cramdesign, mattheu, gcorne, melchoyce, see #27320, fixes#27376, fixes#27354
Built from https://develop.svn.wordpress.org/trunk@27578
git-svn-id: http://core.svn.wordpress.org/trunk@27421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The best (and most cautious) way to tackle this is to whitelist types by browser. Imagine that one implemented MEjs in TinyMCE's rich editor mode, this would be very helpful.
Add `isCompatible( $media )` to `wp.media.mixin`. Future features will use this.
See #27389.
Built from https://develop.svn.wordpress.org/trunk@27539
git-svn-id: http://core.svn.wordpress.org/trunk@27382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `removePlayer()` is an alternative to MediaElement's player removal method that does not re-add the audio|video element back to the DOM.
* `unsetPlayer()` will check for an existing `player` property on the passed instance and pause all players before calling `unsetPlayer()`
See #27389.
Built from https://develop.svn.wordpress.org/trunk@27538
git-svn-id: http://core.svn.wordpress.org/trunk@27381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `src` is set, and 'Add a Source' results in the same file (or a file with the same extension) being added
* `src` is set, and 'Replace Audio|Video' is used, which will add a model property named by the attachment's extension
... call `model.unset( 'src' )`.
See #27389.
Built from https://develop.svn.wordpress.org/trunk@27536
git-svn-id: http://core.svn.wordpress.org/trunk@27379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Move TinyMCE shortcode handling from `wpgallery` plugin to `mce-view.js`
* Force `preload="none"` when rendering media in the editor to ensure fast loading (I realize this sounds illogical)
* Move audio and video tag builder logic in `media-template.php` into PHP funcs that can be reused by any code passing `data.model` to an Underscore template
* Pause all players when moving between editor tabs and when moving from the editor to editing in the media modal.
* Rename `wp.media.audio|video.shortcode()` to the more appropriate `wp.media.audio|video.update()` that now returns a `wp.shortcode` object instead of a string.
* Add necessary MediaElement css files to `$mce_css`
* In `wp.mce.View.render()`, support multiple instances of the same shortcode
* When rendering `wp.mce.View`s, fire a ready event that passes the current MCE View root element as context
See #27389.
Built from https://develop.svn.wordpress.org/trunk@27528
git-svn-id: http://core.svn.wordpress.org/trunk@27371 1a063a9b-81f0-0310-95a4-ce76da25c4cd