Commit Graph

463 Commits

Author SHA1 Message Date
Drew Jaynes
d4dd02b4ae Remove backticks on $post variables in some short parameter descriptions.
See [28653], [28654].
See #28388.

Built from https://develop.svn.wordpress.org/trunk@28976


git-svn-id: http://core.svn.wordpress.org/trunk@28765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-03 19:28:14 +00:00
Sergey Biryukov
428a83259e Avoing a PHP warning in media modal if the attached file does not exist.
props kovshenin.
see #24716.
Built from https://develop.svn.wordpress.org/trunk@28959


git-svn-id: http://core.svn.wordpress.org/trunk@28755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-02 14:37:15 +00:00
Sergey Biryukov
f799048057 Pass $url parameter to wp_embed_defaults() and 'embed_defaults' filter.
props wpsmith, sabreuse, jacobdubail.
fixes #20151.
Built from https://develop.svn.wordpress.org/trunk@28923


git-svn-id: http://core.svn.wordpress.org/trunk@28722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-30 11:16:15 +00:00
Drew Jaynes
6216aa2331 Add documentation for the default playlist shortcode attributes in wp_playlist_shortcode().
Props taylorde.
Fixes #28678.

Built from https://develop.svn.wordpress.org/trunk@28901


git-svn-id: http://core.svn.wordpress.org/trunk@28700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 21:29:17 +00:00
Andrew Ozz
b9fd9db83b Uploader: enable selecting multiple files on mobile devices (still doesn't work on Android). See #28640.
Built from https://develop.svn.wordpress.org/trunk@28847


git-svn-id: http://core.svn.wordpress.org/trunk@28651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 04:15:15 +00:00
Scott Taylor
2efb8f8507 When wp_oembed_add_provider() or wp_oembed_remove_provider() is called before the plugins_loaded hook has, store the values statically on the WP_oEmbed object and add them just-in-time when the object is instantiated.
This ensures that all plugins have an accurate provider list when `apply_filters( 'oembed_providers', $providers )` is called. 

Props kovshenin.
Fixes #28284.

Built from https://develop.svn.wordpress.org/trunk@28846


git-svn-id: http://core.svn.wordpress.org/trunk@28650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-26 02:30:15 +00:00
Helen Hou-Sandí
b5ef672c6b Grid view for the media library, first pass. This is alpha; expect imperfection. We will be iterating further.
props ericlewis, shaunandrews, wonderboymusic.
see #24716.

Built from https://develop.svn.wordpress.org/trunk@28682


git-svn-id: http://core.svn.wordpress.org/trunk@28500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-05 22:01:18 +00:00
Drew Jaynes
b0877f02a4 Make sure $post is properly documented as optional where applicable.
See #28388.

Built from https://develop.svn.wordpress.org/trunk@28653


git-svn-id: http://core.svn.wordpress.org/trunk@28471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-03 03:53:17 +00:00
Scott Taylor
91e6a8c017 Because of YouTube's overwhelming dominance in the online video space, we should help our users who paste bad URLs when possible. It is easy to fix http://youtube.com/embed/acb1233 URLs by turning them into http://youtube.com/watch?v=abc1233 embeds using an embed handler (we already have one to fix Google Video embeds).
We should avoid doing this in almost every other case, but it's YouTube, and it's an easy error for a novice to make.

Fixes #24660.

Built from https://develop.svn.wordpress.org/trunk@28652


git-svn-id: http://core.svn.wordpress.org/trunk@28470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-02 01:22:15 +00:00
Sergey Biryukov
2b6c8462b3 Avoid a PHP notice in adjacent_image_link() if no images were found.
props nabil_kadimi.
see #28361.
Built from https://develop.svn.wordpress.org/trunk@28584


git-svn-id: http://core.svn.wordpress.org/trunk@28409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-27 10:55:16 +00:00
Scott Taylor
dd25ef25d9 $count is set in get_post_galleries() and never used, relic from PFUI RIP.
See #27882.

Built from https://develop.svn.wordpress.org/trunk@28550


git-svn-id: http://core.svn.wordpress.org/trunk@28376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-22 19:13:14 +00:00
Scott Taylor
abff6bf6cf $gallery_div is set twice in gallery_shortcode() before it is used.
See #27882.

Built from https://develop.svn.wordpress.org/trunk@28549


git-svn-id: http://core.svn.wordpress.org/trunk@28375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-22 19:12:14 +00:00
Scott Taylor
e4bc49c244 Because PHP can be configured without --filter, it is not 100% safe to use filter_var(). This is problematic for casting "false" to false, as PHP always casts it to true. FILTER_VALIDATE_BOOLEAN fixes this, but it may not be available.
Add a new function, `wp_validate_boolean()`, to replace `filter_var( $var, FILTER_VALIDATE_BOOLEAN )`.

Fixes #28170.


Built from https://develop.svn.wordpress.org/trunk@28542


git-svn-id: http://core.svn.wordpress.org/trunk@28368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-22 18:34:15 +00:00
Scott Taylor
dcc6cbc04f Eliminate use of extract() in gallery_shortcode().
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28414


git-svn-id: http://core.svn.wordpress.org/trunk@28241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-15 03:41:15 +00:00
Drew Jaynes
08824b6529 Add a complete short description to the get_attached_media filter documentation.
See #26869.

Built from https://develop.svn.wordpress.org/trunk@28377


git-svn-id: http://core.svn.wordpress.org/trunk@28205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-13 04:21:14 +00:00
Scott Taylor
3bbed6ceac audio, video, and playlist shortcodes:
* Convert all instances of variable variables to array properties
* Eradicate use of `extract()`
* Rename `$atts` to `$html_atts` where collision with new `$atts` (shortcode atts holder) var might occur

See #22400, #27881.


Built from https://develop.svn.wordpress.org/trunk@28342


git-svn-id: http://core.svn.wordpress.org/trunk@28170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-07 17:36:18 +00:00
John Blackbourn
ab041987d3 Remove some unnecessary abstraction introduced in [28191]. See #27985.
Built from https://develop.svn.wordpress.org/trunk@28194


git-svn-id: http://core.svn.wordpress.org/trunk@28024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-24 11:55:22 +00:00
John Blackbourn
d6e03df3c9 Avoid an expensive attachment counting query on the post editing screen. See #27985, for trunk.
Built from https://develop.svn.wordpress.org/trunk@28191


git-svn-id: http://core.svn.wordpress.org/trunk@28021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-23 22:05:16 +00:00
Scott Taylor
55becc0dfd Refinements for asynchronous rendering in wp.mce.media.PlaylistView:
* Add `visibility: hidden` as an inline style to `<audio>` tags, there is a race with the stylesheet which can get enqueued in the body and loaded in the footer.
* When creating new instances of `MediaElementPlayer`, always push them onto a stack. Lone views can be responsible for multiple instances of the same shortcode on render.
* Rename `wp.media.mixin.unsetPlayer()` to `wp.media.mixin.unsetPlayers()` to reflect the above.
* Call `wp.media.mixin.unsetPlayers()` on the view's `unbind()` method, instead of inline in the `render()` method
* Make sure `WPPlaylistView` is instantiated for each editor instance
* Ensure that the `No Items Found` view state is not rendered when attachments actually do exist.

Props gcorne, wonderboymusic.
See #27899.



Built from https://develop.svn.wordpress.org/trunk@28182


git-svn-id: http://core.svn.wordpress.org/trunk@28013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-22 17:53:16 +00:00
Andrew Nacin
f6387ec25a Properly translate 'Select Poster Image'.
props dimadin.
see #27845, for trunk.

Built from https://develop.svn.wordpress.org/trunk@28168


git-svn-id: http://core.svn.wordpress.org/trunk@27999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-19 18:28:15 +00:00
Andrew Nacin
e3a4c57563 Final about page.
props melchoyce, helen, wonderboymusic, nacin, and the illustrious Michael Pick.
fixes #27713, #27837.

Built from https://develop.svn.wordpress.org/trunk@28150


git-svn-id: http://core.svn.wordpress.org/trunk@27981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-16 17:40:14 +00:00
Andrew Nacin
e8020e91fd Cast wp_count_attachments() before iterating it to avoid a notice when items exist without a mime type.
props bobbingwide.
fixes #27802.

Built from https://develop.svn.wordpress.org/trunk@28139


git-svn-id: http://core.svn.wordpress.org/trunk@27970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-16 00:00:15 +00:00
Drew Jaynes
da896b7cf3 Inline documentation for hooks in wp-includes/media.php.
Props scottlee for the initial patch. Props kpdesign, DrewAPicture.
Fixes #27718.

Built from https://develop.svn.wordpress.org/trunk@28128


git-svn-id: http://core.svn.wordpress.org/trunk@27959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-15 01:36:14 +00:00
Andrew Nacin
bfe44f07a3 Plupload: Restore 3.8 handles and filenames to avoid breaking plugins.
fixes #27763.

Built from https://develop.svn.wordpress.org/trunk@28108


git-svn-id: http://core.svn.wordpress.org/trunk@27939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-14 00:07:16 +00:00
Andrew Nacin
e8da400c69 Don't show featured images for image attachments. Remove abstractions for now.
fixes #27673.

Built from https://develop.svn.wordpress.org/trunk@28051


git-svn-id: http://core.svn.wordpress.org/trunk@27881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 17:40:28 +00:00
Andrew Nacin
4d6fcfdba1 Escape playlist data in templates.
props wonderboymusic.
fixes #27710.

Built from https://develop.svn.wordpress.org/trunk@28050


git-svn-id: http://core.svn.wordpress.org/trunk@27880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 17:40:14 +00:00
Andrew Nacin
6b41f728d4 Header Images: Add suggested dimensions to the media workflow.
props ehg, gcorne.
see #21785.

Built from https://develop.svn.wordpress.org/trunk@28030


git-svn-id: http://core.svn.wordpress.org/trunk@27860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 01:55:15 +00:00
Scott Taylor
42a66ea424 Make playlist tracks keyboard-accessible.
Fixes #27644.


Built from https://develop.svn.wordpress.org/trunk@28023


git-svn-id: http://core.svn.wordpress.org/trunk@27853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 22:28:16 +00:00
Drew Jaynes
eebf49c180 General PHPDoc improvements in wp-includes/media.php for 3.9 functionality.
See #27700.

Built from https://develop.svn.wordpress.org/trunk@28004


git-svn-id: http://core.svn.wordpress.org/trunk@27834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 20:38:15 +00:00
Scott Taylor
2c88f6e941 [27640] supported a caption for audio and video shortcodes as part of a UX iteration for the related MCE views. These captions have since be excluded, so the extra code should be removed (it was there for this sole reason).
See #27320.


Built from https://develop.svn.wordpress.org/trunk@27979


git-svn-id: http://core.svn.wordpress.org/trunk@27809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 06:13:18 +00:00
Scott Taylor
7689cc4a74 When dynamically instantiating MediaElementPlayer instances in JS, preload="metadata" is extremely wonky. preload="none" lets the file play right away.
This has already been addressed for audio|video shortcodes, but also needs to be the case for playlists. When loading a playlist from a DOM cache or via AJAX, and when the sources match those already pre-loaded, the browser will sometimes donkey-punch the HTTP request for the first cached track selected.

Set `preload="none"` for the empty `<audio|video>` tag for playlists.

See commits related to #26779.


Built from https://develop.svn.wordpress.org/trunk@27974


git-svn-id: http://core.svn.wordpress.org/trunk@27804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-06 21:33:15 +00:00
Scott Taylor
3238664215 Revert the changes made to data.title in playlist Underscore templates in [27869]. {{ data.title }} causes the title to be double-encoded on the front end.
See #27574.


Built from https://develop.svn.wordpress.org/trunk@27960


git-svn-id: http://core.svn.wordpress.org/trunk@27790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-05 20:06:16 +00:00
Andrew Nacin
5e79b94d81 Header images: Handle cropping failures.
props ehg.
see #21785.

Built from https://develop.svn.wordpress.org/trunk@27946


git-svn-id: http://core.svn.wordpress.org/trunk@27776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-04 15:48:16 +00:00
Andrew Nacin
079ddec045 Remove <br> elements for HTML5 galleries.
props obenland.
fixes #27637, see #26697.

Built from https://develop.svn.wordpress.org/trunk@27914


git-svn-id: http://core.svn.wordpress.org/trunk@27745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-02 21:50:14 +00:00
Scott Taylor
55b61b7a70 Re-instantiate the MediaElementPlayer instance when switching mime types in playlists.
Fixes #27608.


Built from https://develop.svn.wordpress.org/trunk@27871


git-svn-id: http://core.svn.wordpress.org/trunk@27702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-31 15:35:15 +00:00
Scott Taylor
01d2062af3 Cleanup up the display, escaping, and handling of ID3 data for media. Rename wp_get_relevant_id3_keys() to wp_get_attachment_id3_keys().
Props nacin.
See #27574.


Built from https://develop.svn.wordpress.org/trunk@27869


git-svn-id: http://core.svn.wordpress.org/trunk@27700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-31 05:16:16 +00:00
Scott Taylor
b6ac65f07f Using percentages for playlist font-sizing was ambitious, but fell prey to editor-style.css in the admin. We have switched to using pixels. The editor styles were also forcing MediaElement players to inherit font-family, which was undesirable. And while we're at it, remove the top and bottom border from the playlist's list of tracks, which adds a dash of lovely to the playlist's default styles.
Props nacin for the addition of `&mdash;` in the playlist track list.
Fixes #27600.


Built from https://develop.svn.wordpress.org/trunk@27865


git-svn-id: http://core.svn.wordpress.org/trunk@27696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-30 22:12:16 +00:00
Andrew Nacin
c95f232727 Cleanups for audio/video metadata, see [27862].
see #27574.

Built from https://develop.svn.wordpress.org/trunk@27864


git-svn-id: http://core.svn.wordpress.org/trunk@27695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-30 21:08:14 +00:00
Scott Taylor
d947a55495 Metadata for audio and video files:
* Make attachment metadata for audio files editable by providing a metabox on the Edit Media page
* Standardize on using the attachment title everywhere
* Label the Caption and Description fields for audio and video appropriately
* Make the playlist Underscore templates more straightforward

See #27574.


Built from https://develop.svn.wordpress.org/trunk@27862


git-svn-id: http://core.svn.wordpress.org/trunk@27693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-30 19:28:16 +00:00
Scott Taylor
c3a2635dc8 Return the default mime icon for playlist items that don't have a featured image in wp_prepare_attachment_for_js().
See [27640].


Built from https://develop.svn.wordpress.org/trunk@27813


git-svn-id: http://core.svn.wordpress.org/trunk@27647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-28 12:50:14 +00:00
Andrew Nacin
e0e8203af0 Galleries: Avoid doubling up clearing br elements.
props drozdz.
fixes #25537.

Built from https://develop.svn.wordpress.org/trunk@27800


git-svn-id: http://core.svn.wordpress.org/trunk@27635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-28 02:41:15 +00:00
Scott Taylor
26773541ab Make sure Playlist states that are audio are marked as such with proper localized strings.
See #27554.

Built from https://develop.svn.wordpress.org/trunk@27789


git-svn-id: http://core.svn.wordpress.org/trunk@27625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 18:37:17 +00:00
Scott Taylor
ff6c0731fa Move counting of attachments for audio/video to the backend, instead of using a reduce function in JS.
See #27554.


Built from https://develop.svn.wordpress.org/trunk@27788


git-svn-id: http://core.svn.wordpress.org/trunk@27624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 18:16:16 +00:00
Scott Taylor
4f868ad882 There is no more video-playlist shortcode. To use video, it is now [playlist type="video" ....]. Also deleting core playlist styles. The style attribute is still supported, defaulting to light. Our core style support was 4-5 CSS rules.
See #27552. Leaving open for comments and potential bugs.


Built from https://develop.svn.wordpress.org/trunk@27785


git-svn-id: http://core.svn.wordpress.org/trunk@27621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 17:58:15 +00:00
Scott Taylor
3171da9986 Pass the default mime-type icon as the image for a track when a featured image is not selected for an item in a playlist. Image display in general can be toggled on/off in the modal via Playlist Settings.
Fixes #27525.


Built from https://develop.svn.wordpress.org/trunk@27735


git-svn-id: http://core.svn.wordpress.org/trunk@27572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-26 12:45:15 +00:00
Scott Taylor
eddc48def7 Don't make mce-view a dependency for media-audiovideo. Make media-audiovideo and wp-playlist dependencies for mce-view and only enqueue mce-view in the admin in wp_enqueue_media(). MCE views don't need to be included when media is loaded on the front end.
Fixes #27509.


Built from https://develop.svn.wordpress.org/trunk@27733


git-svn-id: http://core.svn.wordpress.org/trunk@27570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-26 12:11:14 +00:00
Helen Hou-Sandí
52d2920891 Use Dashicon-style images for mime type icons. Actually moving to Dashicons via the font can be explored later, but has theme/plugin implications and requires too many changes to make it for 3.9. props melchoyce for the icons. fixes #26650.
Built from https://develop.svn.wordpress.org/trunk@27726


git-svn-id: http://core.svn.wordpress.org/trunk@27563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 21:10:15 +00:00
Andrew Nacin
60676ee282 Introduce HTML5 caption support.
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
2014-03-24 02:05:14 +00:00
Andrew Ozz
69b74a75cd Plupload: switch to urlstream upload method when the 'flash' runtime is used in non IE browsers. This ensures cookies are sent but limits the maximum file size that flash can handle.
By default only IE9 and older use flash so this change is mostly for completeness. It would affect only the (extremely rare) cases where a plugin disables the html5 runtime.
Built from https://develop.svn.wordpress.org/trunk@27662


git-svn-id: http://core.svn.wordpress.org/trunk@27505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 23:45:19 +00:00
Scott Taylor
38d1fb971f Turn on thumbnail support for attachment:audio and attachment:video. Change conditionals to check for theme OR post type support when determining whether to turn on the Featured Image UI pieces in the admin.
Fixes #27460.


Built from https://develop.svn.wordpress.org/trunk@27657


git-svn-id: http://core.svn.wordpress.org/trunk@27500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 02:35:14 +00:00