Commit Graph

290 Commits

Author SHA1 Message Date
Andrew Nacin 672bd9a43d Media: Pass thumbnail and medium sizes to image_constrain_size_for_editor() to force constraints based on the current DB options for those sizes. History: see #22598, #22738.
props jond3r.
see #23102.
for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@23264 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-04 08:52:18 +00:00
Andrew Nacin dec369d6c8 Media: Restore 3.4 behavior by consulting the old-school DB options for default align, size, and link properties.
This restores linking to media files as the default, over attachment pages. This 'default' cannot currently be changed by a user setting (per 3.4 behavior), due to the default database schema.

see #22841, for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@23262 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-04 08:02:16 +00:00
Andrew Nacin 035eb58af9 Limit the execution of wp_enqueue_media() to once per page. Prevents multiple _wpMediaViewsL10n variables. see #22843.
git-svn-id: https://develop.svn.wordpress.org/trunk@23214 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-27 16:07:12 +00:00
Helen Hou-Sandi 15147020c8 Correct phpdoc @since for wp_oembed_remove_provider(). props hebbet. fixes #22788.
git-svn-id: https://develop.svn.wordpress.org/trunk@23186 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-20 15:22:21 +00:00
Ryan Boren 85b8c87a7e Introduce previous_image_link and next_image_link filters. Allows customizing the gallery display order.
Props nacin
fixes #22829 for trunk


git-svn-id: https://develop.svn.wordpress.org/trunk@23139 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-09 19:54:23 +00:00
Andrew Nacin 24027fdcd7 A neditor is a curious multi-celled organism found deep in the Content Management System "WordPress". It generally subsides on good content. It has an obsession with retina-quality graphical elements, and also has a strong affinity for puns. Occasionally, ACCIDENTAL CAPS LOCK occurs. Some organisms carry British accents; these are prone to changing state but then reverting to their previous state soon after. One has shown superior sleuthing abilities, despite having hardly left its Uni laboratory. Organisms from Australia are usually found deeper in the Content Management System, most of its energy spent on locomotion.
The attitude of a neditor is best described as cranky optimism. Younger organisms are more eager, but quickly tire after working on little sleep. They eventually evolve into the cranky optimism stage in a process that generally takes three to five months.



git-svn-id: https://develop.svn.wordpress.org/trunk@23105 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 09:01:11 +00:00
Andrew Nacin b540525589 Break wp_print_media_templates() into wp-includes/media-template.php and lazy-load that file through wp_enqueue_media(). fixes #22778.
git-svn-id: https://develop.svn.wordpress.org/trunk@23101 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 07:10:20 +00:00
Mark Jaquith affd3a9a98 Remove the "Describe this ___" string on captions in the attachment details view. WP <3 patches with net red. props helenyhou. fixes #22777
git-svn-id: https://develop.svn.wordpress.org/trunk@23097 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 06:35:13 +00:00
Mark Jaquith 6247c1289c Present the correct downsized image dimensions in the Media modal when inserting. Introduces a context parameter for image_constrain_size_for_editor() instead of relying on is_admin(). props jond3r, nacin. fixes #22738
git-svn-id: https://develop.svn.wordpress.org/trunk@23096 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 06:25:39 +00:00
Mark Jaquith e0f5f47c57 Add the ability to click "Edit" and kick out to the advanced image editor from within the Media modal. New window, with "Refresh" offered on your return. fixes #22743. props koopersmith, nacin, helenyhou.
git-svn-id: https://develop.svn.wordpress.org/trunk@23095 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 05:52:19 +00:00
Andrew Nacin dc3a34b19b Restore captions for non-image attachments. see #22759.
git-svn-id: https://develop.svn.wordpress.org/trunk@23087 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:36:17 +00:00
Andrew Nacin 1cc12103f5 Restore the Description field to the media UI in 3.5.
We tried in vain -- a noble but ultimately failed effort -- to reduce the number of fields for attachments from four (title, caption, alt, description) to one (caption for images, title otherwise). Alternative text needed to stay for accessibility reasons, of course.

Eventually title returned due to heavy plugin reliance. Description is too used by too many plugins (often times incorrectly -- the caption is more likely the proper field), hence its less-than-triumphant return today.

Version 3.5 has tried to streamline media in a number of ways. Removing fields may have been too much at once, as it forced not only a user interface change, but a paradigm change as well.

Finally, on upload we populate the description field with IPTC/EXIF captions, rather than the caption field. See #22768, this should be fixed. For now, Description stays.

This commit also restores 'Title' attribute editing to the main tab of the Edit Image dialog. The "Title" field no longer populates title attributes for <img> tags by design (for accessibility and other purposes, see #18984). So, here is a more obvious 'workaround' for the tooltip community.

Finally, this:
 * Cleans up the post.php attachment editor, including by showing a prettier form of the mime type.
 * Enables plugins to specifically hide attachment_fields_to_edit from either post.php (where you can create meta boxes) or the modal (which you may not want to clutter), for compatibility reasons.
 * Hides the 'Describe this file...' placeholder when a field is read-only in the modal.

props nacin, helenyhou.
fixes #22759.



git-svn-id: https://develop.svn.wordpress.org/trunk@23083 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 00:41:06 +00:00
Andrew Nacin 0d7c64c9fd Media: Final names for the actions in the dialog sidebar: "Insert from URL" and "Set Featured Image" to go with "Insert Media" and "Create Gallery".
Longer strings (such as a translation) looks excellent when it wraps to another line.

props markjaquith, fixes #22753.



git-svn-id: https://develop.svn.wordpress.org/trunk@23076 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 19:07:48 +00:00
Andrew Nacin bdba526d83 Media: Use '%d selected' for the selection string, and offer a comment to translators to help them find a workable solution with this would-be plural string. fixes #22749. see #22229.
git-svn-id: https://develop.svn.wordpress.org/trunk@23075 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 19:03:38 +00:00
Mark Jaquith 92793b6ec2 Intelligently make media fields readonly when the user cannot update or do anything with them. props koopersmith, helenyhou, nacin. fixes #22613
git-svn-id: https://develop.svn.wordpress.org/trunk@23072 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 10:29:24 +00:00
Andrew Nacin f79847866e Media IE7 fixes. props azaozz, lessbloat. fixes #22732.
git-svn-id: https://develop.svn.wordpress.org/trunk@23061 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 03:15:53 +00:00
Andrew Nacin a033ad1ab2 Image editor doc fixes. props DH-Shredder. see #6821.
git-svn-id: https://develop.svn.wordpress.org/trunk@23038 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 19:42:28 +00:00
Ryan Boren fa4b718809 Only show Delete in media modal if the user can delete.
Props nacin, koopersmith
fixes #22711


git-svn-id: https://develop.svn.wordpress.org/trunk@23032 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 18:33:51 +00:00
Andrew Nacin dffb1b36d5 Add context to the 'Random' string. It is now used in two places: gallery order and the links widget. props pavelevap, fixes #22724.
git-svn-id: https://develop.svn.wordpress.org/trunk@23021 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 14:49:44 +00:00
Andrew Nacin 3864c9848c Media: Remove four unused strings. props dimadin. fixes #22688.
git-svn-id: https://develop.svn.wordpress.org/trunk@23011 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 04:16:56 +00:00
Andrew Nacin 63aa98ed0c Media: When an image does not have all image sizes available, make sure we insert the requested size into the editor. props koopersmith. fixes #22693.
git-svn-id: https://develop.svn.wordpress.org/trunk@23008 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 04:04:45 +00:00
Ryan Boren 00e20a52dc Final round of media UX improvements.
Props koopersmith
fixes #21390 #22502


git-svn-id: https://develop.svn.wordpress.org/trunk@23006 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 01:26:03 +00:00
Ryan Boren 71d333f660 In the QuickPress media modal, use the new post id when a post is published.
Props nacin, koopersmith
fixes #22673


git-svn-id: https://develop.svn.wordpress.org/trunk@22994 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 07:17:10 +00:00
Ryan Boren 7ad3d2410c Show a spinner when attachment details are saved.
Props koopersmith
see #22613


git-svn-id: https://develop.svn.wordpress.org/trunk@22991 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 06:37:49 +00:00
Ryan Boren 9cdc4de444 Add random and reverse sorting options to gallery settings.
Props koopersmith
fixes #22637


git-svn-id: https://develop.svn.wordpress.org/trunk@22987 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 05:32:25 +00:00
Andrew Nacin 86a0b9ad45 Media: Prevent the compat view from wrapping around the attachment details. Allow the filename to break-word. props koopersmith, SergeyBiryukov. fixes #22667.
git-svn-id: https://develop.svn.wordpress.org/trunk@22983 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 04:15:32 +00:00
Andrew Nacin f88b538001 Bring Featured Images back into the main media dialog.
Most users don't realize that the Featured Image meta box exists; if they do, few use it.

Restores the old meta box UI, including the admin_post_thumbnail_html filter. If a plugin is using _wp_post_thumbnail_html() in conjunction with Thickbox elsewhere, it will also magically still work.

Specific underlying changes:
 * Converts the modal view to use the view manager, which means that a call to open() will automatically call render and attach if necessary.
 * Doesn't automatically set a state in wp.media, to allow code to customize the states to be added before activation.

props koopersmith.
fixes #21776.



git-svn-id: https://develop.svn.wordpress.org/trunk@22979 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 02:38:10 +00:00
Daryl Koopersmith 8a6d1c5b89 Prevent small thumbnails from being upscaled. props helenyhou. fixes #22681.
git-svn-id: https://develop.svn.wordpress.org/trunk@22978 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 00:42:26 +00:00
Andrew Nacin 8cd2af059b Media templates: Make sure we have a width and height before printing dimensions. We don't calculate dimensions for icons. fixes #22680.
git-svn-id: https://develop.svn.wordpress.org/trunk@22976 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 21:53:45 +00:00
Andrew Nacin 1839a359b9 Add wp_enqueue_media action to the function of the same name. props koopersmith, fixes #22678.
git-svn-id: https://develop.svn.wordpress.org/trunk@22969 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 16:33:20 +00:00
Andrew Nacin d8e714d6e3 Allow the 'Uploaded to this post' view to be sorted, saving the resulting order as menu_order.
This functionality is designed to be backwards compatible with manual querying for attachments by menu_order.

props koopersmith.
see #22607.



git-svn-id: https://develop.svn.wordpress.org/trunk@22967 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 16:06:31 +00:00
Ryan Boren c53137f535 Scope button classes so they can be used on the frontend without interfering with theme styles.
Props helenyhou, koopersmith
fixes #22644


git-svn-id: https://develop.svn.wordpress.org/trunk@22948 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 13:40:59 +00:00
Ryan Boren cdce6a366e Introduce API to add back the description field in the new media popup.
Props nacin
fixes #22642


git-svn-id: https://develop.svn.wordpress.org/trunk@22929 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 23:52:30 +00:00
Ryan Boren 49b230b82a Icons for select, deselect, and window close in the media modal.
Props JerrySarcastic, helenyhou, ocean90, lessbloat
fixes #22610


git-svn-id: https://develop.svn.wordpress.org/trunk@22920 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 14:36:12 +00:00
Ryan Boren bb1760e226 Route uploads through async-upload.php instead of admin-ajax.php.
Props nacin, koopersmith
fixes #22622


git-svn-id: https://develop.svn.wordpress.org/trunk@22902 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 20:17:57 +00:00
Andrew Nacin 2520705252 Media: Rename the dialog to 'Add Media' from 'Insert Media' to match the button. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22895 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 17:18:50 +00:00
Andrew Nacin 82622db77e In the gallery shortcode, handle mapping of "ids" to include and orderby before the post_gallery filter. see #21816. fixes #22617.
git-svn-id: https://develop.svn.wordpress.org/trunk@22891 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 03:51:27 +00:00
Andrew Nacin 0cebbfe3e6 Media: Remove the link to the browser uploader. The only need for it is large files (> 100MB) in certain browsers (IE, Opera), so we will show the link then only. fixes #22604.
git-svn-id: https://develop.svn.wordpress.org/trunk@22889 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 02:28:10 +00:00
Andrew Nacin 6b911fa633 wp_print_media_templates() does not take an argument.
git-svn-id: https://develop.svn.wordpress.org/trunk@22884 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 23:50:26 +00:00
Andrew Nacin da9ff4451d When editing a plain, legacy [gallery] shortcode, ensure we are sorting its contents using menu_order.
When attachments are sorted, we convert the shortcode to [gallery ids=""], as before.

props koopersmith.
fixes #22608.



git-svn-id: https://develop.svn.wordpress.org/trunk@22882 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 23:20:12 +00:00
Ryan Boren d2d01ad797 Always send nocache_headers() for admin-ajax.php. This prevents iOS from caching ajax calls. http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results
Turn off multi selection uploads for mobile devices. Currently Plupload cannot upload multiple files in iOS Safari. Only the first file makes it to the queue. 

Empty wp on unload to work around caching in iOS Safari.

Props azaozz, miqrogroove, nacin

fixes #22552


git-svn-id: https://develop.svn.wordpress.org/trunk@22872 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 16:17:53 +00:00
Ryan Boren e0a32fe27b Fix overflow of long filenames in the media modal.
Props koopersmith, GregLone
fixes #22554


git-svn-id: https://develop.svn.wordpress.org/trunk@22870 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:58:47 +00:00
Ryan Boren 6a9c14ed5f Add a delete link to the media modal.
Props merty, nacin, koopersmith
fixes #22524


git-svn-id: https://develop.svn.wordpress.org/trunk@22869 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:50:59 +00:00
Ryan Boren 1f4eed3141 Don't use "embed" when referring to inserting from URL.
Props nacin
fixes #22603


git-svn-id: https://develop.svn.wordpress.org/trunk@22868 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:35:36 +00:00
Andrew Nacin 929d79714b Remove wp_image_editor_class filter. wp_image_editors is sufficient. props scribu. fixes #22538.
git-svn-id: https://develop.svn.wordpress.org/trunk@22859 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 02:27:11 +00:00
Ryan Boren 283e33bd58 Make wp_prepare_attachment_for_js() compatible with plugins that disable all intermediate image sizes (so no images are created on upload), and then create them on the fly using the image_downsize filter (say, with a URL that can dynamically create images on the fly).
Props nacin
fixes #22598


git-svn-id: https://develop.svn.wordpress.org/trunk@22850 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:46:56 +00:00
Ryan Boren 7ce1968d15 In media_buttons(), consult global post_ID if get_post() comes up with nothing.
Default postID to 0 in wp_enqueue_media().

Props nacin
fixes #22085


git-svn-id: https://develop.svn.wordpress.org/trunk@22846 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:03:37 +00:00
Daryl Koopersmith 383e24fcfe Add print_media_templates action to allow custom templates to be added. props ocean90. fixes #22565, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22832 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-25 21:45:30 +00:00
Ryan Boren 7fbcbebc3d Handle attachments that have an empty mime type or a mime type without a subtype.
Props SergeyBiryukov
fixes #22532


git-svn-id: https://develop.svn.wordpress.org/trunk@22830 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-23 16:32:21 +00:00
Daryl Koopersmith f20573509b Media: Use a full uploader status view in the inline uploader. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22825 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 12:54:49 +00:00