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: http://core.svn.wordpress.org/trunk@23083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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: http://core.svn.wordpress.org/trunk@22979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This functionality is designed to be backwards compatible with manual querying for attachments by menu_order.
props koopersmith.
see #22607.
git-svn-id: http://core.svn.wordpress.org/trunk@22967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the 3.4 branch we bumped the DB version past the version used for disabling links in trunk, preventing it from running. In the future, we must avoid increasing branch DB version bumps to HEAD.
props SergeyBiryukov.
fixes#22626.
git-svn-id: http://core.svn.wordpress.org/trunk@22911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Finalize the text for the media pointer. Offer it for translation.
* Remove the favorites pointer.
fixes#22454.
git-svn-id: http://core.svn.wordpress.org/trunk@22874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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: http://core.svn.wordpress.org/trunk@22872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In WP_Image_Editor_GD::test(), check for existence of imagerotate if the rotate capability is required.
Props DH-Shredder
fixes#22597
git-svn-id: http://core.svn.wordpress.org/trunk@22863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In media-new.php, use post_id from REQUEST if passed and the current user can edit the post.
Fixes adding media with the browser uploader.
Props nacin, ocean90
fixes#22572
git-svn-id: http://core.svn.wordpress.org/trunk@22853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The difference is the content type: application/json (which jQuery deserializes automatically for us) and the default text/html.
jQuery correctly handles application/json requests for IE, so we can continue to use the wp_send_json_* handlers elsewhere. Plupload rolls its own requests and does not handle application/json correctly. So, keep the standard text/html content type on upload-attachment.
props koopersmith.
see #22446.
git-svn-id: http://core.svn.wordpress.org/trunk@22845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Have wp_get_image_editor() rather than WP_Image_Editor::get_instance(). Having static factory methods would be less confusing if there weren't also static methods tied to individual editor implementations.
* Lazy-load the WP_Image_Editor base class and editor implementations.
* Have WP_Image_Editor_GD::supports_mime_type() actually check which types it supports.
* Deprecate gd_edit_image_support() in favor of wp_image_editor_supports().
props DH-Shredder, scribu, markoheijnen. fixes#22356. see #6821.
git-svn-id: http://core.svn.wordpress.org/trunk@22817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Use the specific post_type's 'edit_post' cap
* Pass the ID of the post being edited.
Fixes#22417
git-svn-id: http://core.svn.wordpress.org/trunk@22769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is bolted on to existing code, the vast majority of which is destined to be ripped out in 3.6 once things settle.
see #22083.
git-svn-id: http://core.svn.wordpress.org/trunk@22755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
We are de-emphasising attaching (see [22630]) but this is existing
core functionality and will remain for now. This commit just cleans
it up a bit so as to be less embarrassing.
props lessbloat, helenyhou.
fixes#20164.
git-svn-id: http://core.svn.wordpress.org/trunk@22723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Use a less specific selector (the body, actually) to delegate opening the media dialog.
* Allow the editor ID to be the empty string so the `media_buttons` action can be called without arguments.
see #22284, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If the user has more than one role, opt to show the first role that is
'editable', if present. Otherwise, fall back to the remaining roles.
In the future, we should show a comma-separated list of all roles,
editable or otherwise, and this list should be filterable, either by user,
or by the roles which can appear. Probably both.
In multisite, only hide users that have no capabilities (in case they
possess a leftover, empty wp_xx_capabilities key from the MU days),
not users that have no role, as they may have a cap but no role.
see #22361. fixes#17860.
git-svn-id: http://core.svn.wordpress.org/trunk@22686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These are the importers we suggest on import.php, prompting the user to
install the relevant plugin for the import they want to go through.
If the API is inaccessible, it falls back to a hard-coded list that should
be kept sync'd with the API with each major version of WordPress. This API
enables us to add new importers between releases, as they are completed or
if services gain quick adoption. As a last resort, we can also temporarily
disable importers that are broken (due to API changes, for example).
The importer currently returns English strings (which are then run through
translate() for existing strings), but the locale is passed to the API,
allowing us to ship translated strings if we wish to be adventurous.
props dllh for the assist.
fixes#18977.
git-svn-id: http://core.svn.wordpress.org/trunk@22632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In 3.5, we have chosen to de-emphasize the "attaching" part of the
post-attachment relationship. Existing functionality remains the same,
but UI emphasis is now placed on "parent" being where the item was
originally uploaded.
fixes#22439.
git-svn-id: http://core.svn.wordpress.org/trunk@22630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Allow passing urls instead of just file paths to WP_Image_Editor_Imagick::load() and WP_Image_Editor_GD::load() so that attachments requiring URL fopen can be handled.
see #6821
git-svn-id: http://core.svn.wordpress.org/trunk@22538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds `createIframeStates()` to the `MediaFrame` view. It creates states and bindings for the `media_upload_tabs` output, and is included on `MediaFrame.Post` by default.
* Hijacks `tb_remove()` when the media modal is open to ensure the modal closes correctly.
* Adds a `chromeless` parameter to thickbox media tab URLs to render the UI without the old row of tabs.
see #22186, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Make test() and supports_mime_type() static.
* Add required_methods argument to get_instance(). Allows requesting an implementation that has certain methods/capabilities.
* Whitespace cleanup
Props markoheijnen
see #6821
git-svn-id: http://core.svn.wordpress.org/trunk@22510 1a063a9b-81f0-0310-95a4-ce76da25c4cd