Commit Graph

571 Commits

Author SHA1 Message Date
Drew Jaynes
1e10385a90 Remove an invalid parameter from the DocBlock for the gallery_style hook.
Props keesiemeijer.
Fixes #30507.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 05:58:47 +00:00
Drew Jaynes
c512f1d916 Remove return descriptions from the DocBlocks for add_image_size() and set_post_thumbnail_size() as they don't return anything.
Also document the `$_wp_additional_image_sizes` global, leveraged in `add_image_size()`.

Props stevegrunwell.
Fixes #30511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 05:49:23 +00:00
Drew Jaynes
b8c612ca1c Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Markdown-indent a code snippet in the file header for wp-admin/install-helper.php
* Add markdown formatting and two inline `@see` tags to the description for `translate()`
* Markdown-indent a code snippet in the description for `_n_noop()`
* Remove HTML tags from the summary for `get_media_embedded_in_content()`
* Remove an HTML tag from the summary for `wpview_media_sandbox_styles()`

Props rarst.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:47:23 +00:00
Sergey Biryukov
8f2842a07e Replace invalid use of ltrim() in attachment_url_to_postid() with substr().
props bradyvercher.
fixes #30346.
Built from https://develop.svn.wordpress.org/trunk@30501


git-svn-id: http://core.svn.wordpress.org/trunk@30490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 06:35:22 +00:00
Andrew Nacin
c2f334bf3c Playlists are video by default. props duck_
Built from https://develop.svn.wordpress.org/trunk@30422


git-svn-id: http://core.svn.wordpress.org/trunk@30417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-20 13:11:23 +00:00
Dominik Schilling
52f51d65ae Media: Remove another unused string.
props pavelevap.
see #29741.
Built from https://develop.svn.wordpress.org/trunk@30342


git-svn-id: http://core.svn.wordpress.org/trunk@30341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-14 17:46:22 +00:00
Dominik Schilling
f34d3b1b5a Media: Remove unused string.
props pavelevap.
fixes #29741.
Built from https://develop.svn.wordpress.org/trunk@30341


git-svn-id: http://core.svn.wordpress.org/trunk@30340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-14 17:31:23 +00:00
Scott Taylor
15c062eb79 In wp_audio|video_shortcode(), make sure that autoplay and loop are booleans. Passing 'false' to them will force them to be active, which is bad.
Fixes #29825.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:03:21 +00:00
Scott Taylor
cd9bb04981 In gallery_shortcode(), when the link attribute is equal to file, make sure to pass $attr as the 6th (!) argument, not 5th, to wp_get_attachment_link().
Props bradyvercher.
Fixes #27402.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 21:47:24 +00:00
Drew Jaynes
66c47f29bb Correct references of @uses $wpdb in core documentation to use @global.
See #30191, [30105].
Fixes #30217.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-31 17:56:22 +00:00
Drew Jaynes
f8657d5890 Remove redundant and erroneous @uses tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Scott Taylor
3d8e31fb82 Don't hardcode height for videos - this was a workaround for MediaElement internals causing problems. Responsive videos now work properly and don't cause extra whitespace.
Fixes MediaElement by hand in the interim: https://github.com/johndyer/mediaelement/pull/1337
Video playlists were completely broken by this.

Fixes #30078.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-29 00:47:24 +00:00
Scott Taylor
5d17d2bd28 The gallery shortcode used to accept a SQL chunk for the value of the orderby attribute. The reason? get_posts() used to be called in the shortcode handler with a query-string blob of arguments passed to it. To mitigate breakage, sanitize_sql_orderby() was created in [7592].
`sanitize_sql_orderby()` expects a comma to be present when multiple `orderby` values were passed. The correct syntax for multiple fields is space-delimited. Since [29027], comma-separated values would never be parsed correctly when passed to `WP_Query->parse_orderby()`.

`sanitize_sql_orderby()` is used nowhere else in core, save for the `playlist` shortcode - I only added it there because I was mimic'ing the `gallery` logic. The function call can be removed from both shortcode handlers.
 
See #6476.
Fixes #23873.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 20:43:22 +00:00
Gary Pendergast
007ec52958 Add wp_json_encode(), a wrapper for json_encode() that ensures everything is converted to UTF-8.
Change all core calls from `json_encode()` to `wp_json_encode()`.

Fixes #28786.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:35:19 +00:00
Scott Taylor
72d12b514d Add a 6th (!) attribute to wp_get_attachment_link() to allow aria-describedby to be added to gallery output.
Props joedolson, DrewAPicture, rianrietveld.
Fixes #27402.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-16 04:28:17 +00:00
Sergey Biryukov
45062d7f5c Update @param docs for wp_get_attachment_image().
see #29869.
Built from https://develop.svn.wordpress.org/trunk@29837


git-svn-id: http://core.svn.wordpress.org/trunk@29601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-05 17:52:15 +00:00
Sergey Biryukov
d769e29279 Pass the requested size to 'wp_get_attachment_image_attributes' filter.
props mattheu.
fixes #29869.
Built from https://develop.svn.wordpress.org/trunk@29836


git-svn-id: http://core.svn.wordpress.org/trunk@29600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-05 17:50:16 +00:00
Andrew Ozz
7a55ab9164 Media: disable multi-file uploading in iOS 7.x Safari as it prevents uploading of videos. Fixes #29602 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29776


git-svn-id: http://core.svn.wordpress.org/trunk@29548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 00:14:18 +00:00
Sergey Biryukov
10e0807cce Add context for 'Trash' string in media modal.
props pavelevap.
fixes #29739.
Built from https://develop.svn.wordpress.org/trunk@29764


git-svn-id: http://core.svn.wordpress.org/trunk@29536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-24 13:49:20 +00:00
Scott Taylor
ee9d74dc05 Ordering by RAND():
The shortcode callbacks for `gallery` and `playlist` check for `'RAND' == $atts['order']`, which isn't a valid value for `order`. Remove those checks and update the docs.

In `WP_Query`, if the value of `orderby` is `rand`, `order` is irrelevant and should be unset.

Adds unit tests.

Fixes #29629.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-23 03:52:15 +00:00
Sergey Biryukov
2008fc0c89 Correct 'wp_get_attachment_image_attributes' filter docs.
props tillkruess.
fixes #29701.
Built from https://develop.svn.wordpress.org/trunk@29750


git-svn-id: http://core.svn.wordpress.org/trunk@29522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-18 12:36:17 +00:00
Andrew Ozz
69e7171f41 Media: revert enabling of multi-file uploading for mobile devices. Currently only iOS Safari supports it but has a bug that prevents uploading of videos. Fixes #29602
Built from https://develop.svn.wordpress.org/trunk@29729


git-svn-id: http://core.svn.wordpress.org/trunk@29503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-10 22:40:16 +00:00
Sergey Biryukov
0113d3457b Avoid PHP notices in media modal caused by orphaned attachments.
fixes #29566 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29724


git-svn-id: http://core.svn.wordpress.org/trunk@29498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-09 10:03:14 +00:00
Andrew Nacin
e496cc6e4b Media: Ensure media-views is enqueued and registered before localizing.
fixes #24724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-02 19:36:16 +00:00
Andrew Ozz
703b625820 Media: add a class to the <script> tag for the JSON encoded playlist data so it can be easily selected in WPPlaylistView. Props SergeyBiryukov, fixes #29383
Built from https://develop.svn.wordpress.org/trunk@29660


git-svn-id: http://core.svn.wordpress.org/trunk@29434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-01 19:55:18 +00:00
Helen Hou-Sandí
72593add22 Media grid: Don't show a misleading message for an empty library.
This uses the existing string from the list table. We should revisit a better overall experience for the two situations (empty library vs. search with no results) in 4.1.

props voldemortensen.
fixes #29404.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-01 18:39:17 +00:00
Scott Taylor
149346ff6e MCE View sandboxes:
* Use a `MutationObserver` to listen to the `body` class of the parent editor frame.
* In `wpview_media_sandbox_styles()`, only return the MEjs stylesheets.
* In `wp_ajax_parse_media_shortcode()` and `wp_ajax_parse_embed()`, return an object instead of an HTML blob to allow passing `body` and `head` separately	

Props avryl, azaozz.
Fixes #29048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-26 04:46:15 +00:00
Scott Taylor
d6213d64a5 After [29543], the iframe sandboxes for media need to load Open Sans. Playlists look aggressively bad without it. Adds font styles for the body.
See #29048.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-21 03:36:16 +00:00
Andrew Ozz
53c047263b TinyMCE wpView: add a filter for the stylesheet URLs loaded in the sandbox iframes. See #29048.
Built from https://develop.svn.wordpress.org/trunk@29559


git-svn-id: http://core.svn.wordpress.org/trunk@29334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-20 21:34:15 +00:00
Andrew Ozz
afdb25bd56 TinyMCE wpView sandbox iframes:
- Make them transparent.
- Don't load tons of unrelated styles that can break them. This could result in minimal styling mismatch to the front-end, but keeps the views working well and looking good.
Props avryl, fixes #29048.
Built from https://develop.svn.wordpress.org/trunk@29543


git-svn-id: http://core.svn.wordpress.org/trunk@29319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-19 21:53:15 +00:00
Sergey Biryukov
6b3a4e6ddd Media Grid: Use an existing string for posts without a title.
see #24716.
Built from https://develop.svn.wordpress.org/trunk@29493


git-svn-id: http://core.svn.wordpress.org/trunk@29271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 21:41:16 +00:00
Scott Taylor
b0c782bf08 Media Grid, support MEDIA_TRASH: add AYS to bulk actions.
See #29145.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 19:08:14 +00:00
Scott Taylor
571111022e Media Grid, support MEDIA_TRASH:
* Add a setting to `_wpMediaViewsL10n.settings`: `mediaTrash`
* In the attachment edit modal, properly toggle between Trash/Untrash
* In `media.view.Attachment`, add a method for `untrashAttachment`
* When creating the grid toolbar, switch the setting order of subviews so that `media.view.DeleteSelectedButton` can listen to the instance of `media.view.AttachmentFilters.All` to update the text in its UI.
* Add a new filter to `media.view.AttachmentFilters.All`, `trash`, when `settings.mediaTrash` is true
* Allow the cached queries in `Query.get()` to be flushed when race conditions exist and collections need to be refreshed. This is currently only being used when `MEDIA_TRASH` is set, to refresh the filtered/mirrored collections related to `all`, `trash`, and any already queried filter.
* Cleanup the bootstrapping of `media.view.MediaFrame.Manage`
* Allow `wp_ajax_query_attachments()` to return items from the trash when `MEDIA_TRASH` is `true`
* Allow `wp_ajax_save_attachment()` to set `post_status` when `MEDIA_TRASH` is `true`. It allows `wp_delete_post()` to be called, which will trash the attachment instead of deleting when the flag is set.

Props koop for the knowledge sharing and thought partnership.
See #29145.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 18:31:19 +00:00
Helen Hou-Sandí
82a69241f1 Remove now-unused strings. see #28842.
Built from https://develop.svn.wordpress.org/trunk@29486


git-svn-id: http://core.svn.wordpress.org/trunk@29264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-14 04:23:16 +00:00
Scott Taylor
9c08ad236a Media Grid: add Bulk Selection mode for deleting attachments.
* Toolbar is sticky when `select` mode is active
* Selection is toggled when clicking an attachment preview
* Unselected attachments fade out, selected fade in.

See #28842.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-13 22:45:15 +00:00
Scott Taylor
1c93f05e2a Upgrade MediaElement to 2.15.0:
* It is required to set `height` on the parent `.wp-video` wrapper for video
* Fixes the play button hover problem in Chrome
* Includes my pull request: https://github.com/johndyer/mediaelement/pull/1273

All changes:
https://github.com/johndyer/mediaelement/compare/2.14.2...master

See #29110.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-09 20:44:17 +00:00
Scott Taylor
28c22db07d Video:
* Don't set height on responsive `<div>` when generating markup
* Move some CSS rules from the style tag to `.wp-video`
* Use Video Details view event delegation instead of click events delegated from `<body>`
* Fix some CSS rule collision in the grid modal

See #29110.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-09 19:39:15 +00:00
Drew Jaynes
647b6d907b Clean up some missing @access tags and other tweaks for 4.0.0-functionality docs.
See #28885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-09 19:32:16 +00:00
Scott Taylor
8c96874742 Media Grid:
* Use a `media.view.Label` instance in the toolbar for the screen reader text for the "all" dropdown.
* Adjust the spinner's priority.

Fixes #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 21:01:15 +00:00
Scott Taylor
ccd0499d96 Media Grid: use a media.view.Label instance in the toolbar for the screen reader text for Search.
See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:54:15 +00:00
Scott Taylor
8593f7b5e9 Media Grid: add screen reader text in a subview on the toolbar, a media.view.Label instance before media.view.DateFilter.
See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:25:16 +00:00
Scott Taylor
3f17e7040e Create a new Backbone view, media.view.Label, which can be used as a subview in things like toolbars, which need screen reader text.
Make an initial instance of it for the label for Bulk Actions in Media Grid.

See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 20:09:17 +00:00
Scott Taylor
c5dff42d51 Revert [29428] to avoid errors with Add Media for now.
See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 19:40:15 +00:00
Scott Taylor
b053fe2e04 Video: use auto instead of actual height for the responsive wrapper in generated markup.
See #29110.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 06:20:15 +00:00
Scott Taylor
b938bfb7d5 MediaElement upgrade: cleanup for generated markup for videos.
See #29110.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 05:53:15 +00:00
Scott Taylor
afb0b3e4ef Media Grid: add screen reader labels with more context to filters and bulk actions. Ditto for list view.
Props afercia.
Fixes #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 05:20:16 +00:00
Scott Taylor
8ed123c97f In media.view.AttachmentFilters.All, make uploaded conditional upon media.view.settings.post.id and include a new filter: unattached.
Drop the `mime-types` filter and related class (which was added for Media Grid) and use `all` instead. 

Props ocean90, wonderboymusic.
Fixes #29065.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-07 04:44:17 +00:00
Scott Taylor
42809dad43 Use proper non-capturing regex syntax for YouTube in wp_video_shortcode().
Props Fab1en.
See [27063].
Fixes #29119.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-06 17:01:17 +00:00
Sergey Biryukov
3f3395a086 Avoid PHP notices in Media Library if an attachment parent post type no longer exists.
Synchronize the 'edit_post' capability check between the list table and the media grid.

fixes #27446.
Built from https://develop.svn.wordpress.org/trunk@29320


git-svn-id: http://core.svn.wordpress.org/trunk@29101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-29 01:41:16 +00:00
Helen Hou-Sandí
6f44e96d70 Set default values for attachment meta and ID3 data when preparing for JS to avoid errors in rendering templates. props ericmann for the initial patch. fixes #29013.
Built from https://develop.svn.wordpress.org/trunk@29281


git-svn-id: http://core.svn.wordpress.org/trunk@29063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 18:04:18 +00:00
Dominik Schilling
270a57075c Media Grid: Add a date filter.
props ericlewis.
fixes #28895.
Built from https://develop.svn.wordpress.org/trunk@29271


git-svn-id: http://core.svn.wordpress.org/trunk@29053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-22 20:47:15 +00:00
Helen Hou-Sandí
06f5b5a490 Media Grid:
Instead of a separate bulk selection mode, persistently show a checkbox for each item. Restores the more familiar bulk actions dropdown + action button.

props ericlewis. see #28842.


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


git-svn-id: http://core.svn.wordpress.org/trunk@28996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 20:42:15 +00:00
Helen Hou-Sandí
b7445ec8a4 Media Grid Attachment Details modal UI improvements:
* Align better visually with the existing media modal and the post image edit modal.
* Add back a link to the full attachment edit screen (post.php).
* Add a title to the modal and move prev/next buttons next to the more-consistent close button.
* Remove mode tabs (metadata vs. image editing) in favor of the Edit Image button.

Still to come: responsive, IE8 testing and targeted CSS (calc() usage), general CSS cleanup.

props ericlewis, helen, melchoyce. see #28844. fixes #28915.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 03:55:15 +00:00
Scott Taylor
89d9bbd7f6 Make audio and video URLs/embed handlers work in <iframe>-sandbox'd MCE views.
Introduce:
`get_editor_stylesheets()`
`wp_media_mce_styles()`.

See #28905.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-15 21:51:15 +00:00
Drew Jaynes
f1b19b24f3 Inline documentation cleanup for 4.0 audit.
Added in [28652]:
* Various phpDoc improvements for `wp_embed_handler_youtube()`
* Adds `@see` reference to `wp_embed_handler_youtube()` in 'wp_embed_handler_youtube' filter docs

Added in [29029]:
* s/post_id/post ID in `@return` description for `attachment_url_to_postid()`

See #28885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-14 01:07:15 +00:00
Dominik Schilling
448422f8ae Media Grid improvements:
* Remove fixed elements.
* Adjusts toolbar and search, fixes #28833.
* Add link to Add New button, fixes #28825.
* Add "Edit Metadata" tab to all items, "Edit Image" only for images
* Make strings translatable.
* First pass for help tab.

see #28850.
Built from https://develop.svn.wordpress.org/trunk@29136


git-svn-id: http://core.svn.wordpress.org/trunk@28920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-13 16:16:15 +00:00
Scott Taylor
e3c39d02cf Media Grid, for audio files: show Bitrate in the Edit Attachments modal a la the Edit Post screen.
See #28839.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 21:56:16 +00:00
Scott Taylor
57dbc55e6e When setting the poster image for a video shortcode, set that image as the featured image for that attachment (if found) in the background. This AJAX functionality could be used for audio as well.
Introduces `attachment_url_to_postid()` to attempt to turn URLs into post IDs.

Fixes #27891.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-08 17:48:17 +00:00
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