Commit Graph

3799 Commits

Author SHA1 Message Date
Andrew Nacin 6e9830f34d Don't stomp existing sizes inside wp_save_image().
props markoheijnen.
see #22985.
for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@23246 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-03 05:23:36 +00:00
Andrew Nacin 416f98b7c8 Remove deleted files on upgrade, including wp-app.php and class-wp-atom-server.php.
props duck_
see #22855
for trunk



git-svn-id: https://develop.svn.wordpress.org/trunk@23203 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-26 20:34:30 +00:00
Helen Hou-Sandi 1303e7377a its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23191 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-20 15:55:32 +00:00
Dion Hulse 0c9c23936b When copying new bundled themes & plugins, bail early if the distro doesn't include the bundled item. This prevents us from creating an empty directory in the destination when the source doesn't exist. See #22856
git-svn-id: https://develop.svn.wordpress.org/trunk@23179 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-15 03:09:50 +00:00
Andrew Nacin 05861ebb8c Use 3 * HOUR_IN_SECONDS rather than 10800.
git-svn-id: https://develop.svn.wordpress.org/trunk@23175 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-12 07:30:28 +00:00
Andrew Nacin 110c7769e5 Rip keyboard shortcuts out of the image editor help. props helenyhou. fixes #22786.
git-svn-id: https://develop.svn.wordpress.org/trunk@23106 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 09:21:27 +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
Mark Jaquith 93442c1773 Run the attachment_fields_to_save filter even if we don't get the fields we used to get. props nacin. fixes #22774
git-svn-id: https://develop.svn.wordpress.org/trunk@23094 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 05:34:17 +00:00
Andrew Nacin 90e5fd56c0 Fix branchhing in edit_post() where attachment_fields_to_save would only run when the alt text was sent. It should run whenever an attachment is saved. props sc0ttclark. fixes #22774.
git-svn-id: https://develop.svn.wordpress.org/trunk@23088 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:50:31 +00:00
Daryl Koopersmith f82ed67255 Add hidden fields via attachment_fields_to_edit to the existing compat output. props nacin. fixes #22769.
git-svn-id: https://develop.svn.wordpress.org/trunk@23086 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:28:21 +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 6c54baea98 Translate the 'First Steps with WordPress' Codex link. props SergeyBiryukov, fixes #22767.
git-svn-id: https://develop.svn.wordpress.org/trunk@23082 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 22:51:24 +00:00
Andrew Nacin a91ebc0abf Media list table: Fix the categories column, hidden thanks to a typo. props eddiemoya, fixes #22764. see #21240, #21391.
git-svn-id: https://develop.svn.wordpress.org/trunk@23081 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 22:49:51 +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 34f181654d Admin ajax: Roll back new-style error sending in set-post-thumbnail. The JS handlers know to parse an unrecognized response (like -1 or 0) as a failure. see #21776. see #22750.
git-svn-id: https://develop.svn.wordpress.org/trunk@23058 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-05 02:34:00 +00:00
Andrew Nacin 71e16147bb Use correct button class hierarchy to ensure the 'Update' button is button-large. see #21598.
git-svn-id: https://develop.svn.wordpress.org/trunk@23044 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-04 22:02:25 +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
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
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
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 efe3a45b76 Namespace the dashboard widget nonce to avoid collisions with plugins.
git-svn-id: https://develop.svn.wordpress.org/trunk@22964 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-02 00:12:43 +00:00
Andrew Nacin d3ab1fe6b8 Remove stray single quote in attachment_submit_meta_box(). props Yogi T. fixes #22674.
git-svn-id: https://develop.svn.wordpress.org/trunk@22962 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-01 18:59:16 +00:00
Ryan Boren 780c0ec85b Properly pass WordPress uploading errors to wp.Uploader.
Props koopersmith
fixes #22655


git-svn-id: https://develop.svn.wordpress.org/trunk@22954 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 15:40:09 +00:00
Ryan Boren 06b9663f58 Refine media state machine methods.
* state( id ) becomes setState( id )
* get( id ) becomes state( id )
* state() stays the same
* previous() becomes lastState()

Props koopersmith
fixes #22652


git-svn-id: https://develop.svn.wordpress.org/trunk@22952 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 15:19:11 +00:00
Ryan Boren e06828a6c4 Add a create_posts check to _wp_translate_postdata(). Move the edit_post check to the top of the function.
Props nacin
fixes #22417


git-svn-id: https://develop.svn.wordpress.org/trunk@22950 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 14:03:47 +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
Andrew Nacin f3da142f01 Nonces for dashboard controls.
git-svn-id: https://develop.svn.wordpress.org/trunk@22930 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 00:01:02 +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
Andrew Nacin a50c33bc44 Fix disabling of the link manager on upgrade from 3.4.2 when there are no links.
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: https://develop.svn.wordpress.org/trunk@22911 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 00:37:30 +00:00
Andrew Nacin cb529c080a Adjust size of the 'Clear List' list table button. Fix placement of other buttons next to bulk actions. props johnbillion, SergeyBiryukov, fixes #22621.
git-svn-id: https://develop.svn.wordpress.org/trunk@22906 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-28 22:20:45 +00:00
Andrew Nacin ae3472b2a2 Feature pointers:
* Finalize the text for the media pointer. Offer it for translation.
 * Remove the favorites pointer.
fixes #22454.



git-svn-id: https://develop.svn.wordpress.org/trunk@22874 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 18:58:07 +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 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 6099051c3e Only show the image edit button for image attachments. Props markoheijnen. fixes #22596
git-svn-id: https://develop.svn.wordpress.org/trunk@22867 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 15:06:02 +00:00
Ryan Boren 8b1ebd858a In wp_image_editor(), use wp_image_editor_supports() to check for rotation capabilities rather than directly checking the existence of the imagerotate function.
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: https://develop.svn.wordpress.org/trunk@22863 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 14:36:55 +00:00
Ryan Boren 2986ab9418 Show a better message ondmins on link-manager.php, link-add.php, link.php when links are disabled.
Props nacin
fixes #22569


git-svn-id: https://develop.svn.wordpress.org/trunk@22855 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 00:20:27 +00:00
Ryan Boren 0ba9380f4e In media_upload_flash_bypass(), pass the post id in the media-new.php url.
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: https://develop.svn.wordpress.org/trunk@22853 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 23:10:19 +00:00
Andrew Nacin 340a772e73 Back compat for media_buttons_context, which is not the correct filter for adding new media buttons. If you want to add additional media buttons, use the media_buttons action instead. fixes #22559.
git-svn-id: https://develop.svn.wordpress.org/trunk@22848 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:32:35 +00:00
Ryan Boren e12621eccb In wp.media.editor:send, revert back to the old field names used by media_upload_form_handler() for easier back compat.
Fix notices in wp_ajax_send_attachment_to_editor().

Props nacin, azaozz, miqrogroove
fixes #22553


git-svn-id: https://develop.svn.wordpress.org/trunk@22847 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 22:08:50 +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
Andrew Nacin 390e1756a1 Don't use wp_send_json_* handlers in the upload-attachment XHR handler.
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: https://develop.svn.wordpress.org/trunk@22845 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 20:12:50 +00:00
Andrew Nacin a2eb48c7ab Media: When inserting an attachment, if the item is unattached (no post_parent), attach it to the post. fixes #22085.
git-svn-id: https://develop.svn.wordpress.org/trunk@22843 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 16:34:42 +00:00
Ryan Boren 8bf86e30f7 Make is_upload_space_available() available for front end page loads. Fixes fatal error when calling wp_editor() from the front end.
Props scribu, itworx
fixes #22585


git-svn-id: https://develop.svn.wordpress.org/trunk@22840 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 14:42:43 +00:00
Andrew Nacin 99097a2096 Only pass the current screen to the list table constructor when we have a screen to work with. This is not the case for admin-ajax requests. fixes #22570.
git-svn-id: https://develop.svn.wordpress.org/trunk@22838 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 03:39:29 +00:00
Andrew Nacin 1b8e6d9ac6 Use correct variable in wp_ajax_save_attachment(). see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22834 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 02:50:01 +00:00
Ryan Boren 8a75568cd4 Gettext markup for a welcome screen string. Props SergeyBiryukov, xibe. fixes #22546
git-svn-id: https://develop.svn.wordpress.org/trunk@22831 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-23 16:42:31 +00:00
Andrew Nacin 4bf9e01c2b Mustn't forget to hide the legacy media uploader! see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22828 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 13:23:27 +00:00
Andrew Nacin f44d1d009e WP_Image_Editor: the last stand.
* 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: https://develop.svn.wordpress.org/trunk@22817 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 09:52:16 +00:00
Andrew Nacin 5e90f834be Two initial feature pointers for WordPress 3.5: plugin favorites and the media dialog. One offered for translation. props nacin, lessbloat, DrewAPicture. see #22454.
git-svn-id: https://develop.svn.wordpress.org/trunk@22815 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 09:24:11 +00:00
Daryl Koopersmith ba65b3ffc7 Media: Replace the thumbnail on post.php using a request variable instead of the referer. props ocean90. fixes #21391.
git-svn-id: https://develop.svn.wordpress.org/trunk@22807 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 03:43:16 +00:00