Commit Graph

95 Commits

Author SHA1 Message Date
Mark Jaquith 3bde819dbe Screen option for Post Format UI.
props nacin. see #23930.

git-svn-id: https://develop.svn.wordpress.org/trunk@24092 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 07:28:33 +00:00
Dominik Schilling (ocean90) d8bf6c44b3 Revisions: Clean up JavaScript variable names, see #23901.
git-svn-id: https://develop.svn.wordpress.org/trunk@24019 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 19:34:21 +00:00
Dominik Schilling (ocean90) b3879a543a Revisions UI: Remove the "To:" prefix from the header when viewing a single revision. Also prefix a revision field with a label.
props SergeyBiryukov, adamsilverstein, faishal. fixes #23903.

git-svn-id: https://develop.svn.wordpress.org/trunk@23994 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-15 18:40:17 +00:00
Andrew Ozz 8ab406d2fb Fix accidental revert of revisions comparison in [23981]
git-svn-id: https://develop.svn.wordpress.org/trunk@23982 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-13 00:45:47 +00:00
Andrew Ozz 7effedba90 Post locks: make sure we never overwrite a draft when it's locked, clean up wp_ajax_autosave() and make wp-refresh-post-lock a bit more robust, see #23697
git-svn-id: https://develop.svn.wordpress.org/trunk@23981 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-13 00:41:15 +00:00
Andrew Ozz 239ccffe14 Revisions: compare revisions by date in wp_ajax_revisions_data(), deprecate the $parent arg in wp_list_post_revisions() as now revisions always include a copy of the current post, props adamsilverstein, see #23901
git-svn-id: https://develop.svn.wordpress.org/trunk@23975 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-12 19:29:21 +00:00
Andrew Nacin c9deeed6e9 Use get_post() in lieu of direct query in wp_ajax_replyto_comment(). fixes #23940.
git-svn-id: https://develop.svn.wordpress.org/trunk@23907 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-04 18:44:38 +00:00
Mark Jaquith 6bae3a6eda A little more revisions js/php cleanup. see #23901. props kovshenin, ocean90.
git-svn-id: https://develop.svn.wordpress.org/trunk@23904 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-04 16:03:21 +00:00
Mark Jaquith 8351c2e87d Further cleanup of revisions code. Probably not the last.
see #23901. props adamsilverstein, azaozz, ocean90.

git-svn-id: https://develop.svn.wordpress.org/trunk@23898 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-04 07:53:49 +00:00
Andrew Nacin 50dffde71f Replace $user_id removed in [23889] with a direct function call. see #23665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23890 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-03 04:37:50 +00:00
Andrew Nacin 085141a6ba No need to check for the presence of a current user in a privileged ajax action. see #23665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23889 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-03 04:34:14 +00:00
Mark Jaquith f18cddb1e1 Make sure the first revision is seen as coming from emptiness, so it can be restored.
props adamsilverstein. fixes #23898.

git-svn-id: https://develop.svn.wordpress.org/trunk@23872 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 20:50:09 +00:00
Mark Jaquith b134331956 Make sure that the ID of the right revision is not less than the ID of the left revision
see #23497

git-svn-id: https://develop.svn.wordpress.org/trunk@23832 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-28 02:49:55 +00:00
Mark Jaquith 240dc4b968 correct a revision/tooltip mismatch.
props adamsilverstein. see #23497

git-svn-id: https://develop.svn.wordpress.org/trunk@23831 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-28 01:51:12 +00:00
Peter Westwood ae03f1a0b6 Revisions: UI Update.
* Refines the UI to make it clearer and easier to use
* Introduces weighted tickmarks
* Fixes comparison bugs.

See #23497 props adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@23769 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-21 15:54:11 +00:00
Ryan Boren 72c65a3145 Fix i18n for revision diff strings displaying human time.
Props johnbillion
fixes #23723


git-svn-id: https://develop.svn.wordpress.org/trunk@23743 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-18 17:58:30 +00:00
Andrew Ozz c996f27c4d Create one autosave per user rather than a single autosave for all users. Remove unused code from autosave.js and wp_ajax_autosave(). See #23665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23735 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-16 21:15:43 +00:00
Mark Jaquith 0132e8100c Introduce [audio] and [video] shortcodes, and use MediaElement.js to play them.
props wonderboymusic. see #23282.

git-svn-id: https://develop.svn.wordpress.org/trunk@23729 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-16 05:25:44 +00:00
Andrew Ozz 860ccd0cba Logged out warnings: remove the logged out warning from autosave when in login_grace_period, see #23295
git-svn-id: https://develop.svn.wordpress.org/trunk@23699 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-14 21:31:02 +00:00
Andrew Ozz a1ae5c0d28 Logged out warnings, heartbeat: remove nopriv_autosave as it doubles the functionality of the logged out warnings, move wp_ajax_nopriv_heartbeat() under No-privilege Ajax handlers in ajax-actions.php, see #23295, see #23216
git-svn-id: https://develop.svn.wordpress.org/trunk@23692 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-13 23:54:12 +00:00
Andrew Ozz 4ad27d6d14 Autosave to the browser's sessionStorage, compare this autosave to the post content on page load and let the user restore it when the data is not the same. First run, see #23220
git-svn-id: https://develop.svn.wordpress.org/trunk@23683 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-13 10:08:16 +00:00
Sergey Biryukov 18d4ae9d54 Fix missing i18n in auto-draft titles. fixes #23565.
git-svn-id: https://develop.svn.wordpress.org/trunk@23663 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-12 08:57:27 +00:00
Andrew Ozz 92c30a26fb Check post locks with heartbeat and display modal notifications when a post is locked or a user takes over editing, props dh-shredder, see #23697
git-svn-id: https://develop.svn.wordpress.org/trunk@23661 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-12 03:22:30 +00:00
Peter Westwood ae4522b5f1 Revisions: Updates to the new Revisions UI.
Various Updates including:
 * i18n fixes
 * Added tracking of what revision ID was restored
 * async fetching of diffs so that slider works sooner even with many revisions

See #23497 props adamsilverstein, ethitter


git-svn-id: https://develop.svn.wordpress.org/trunk@23639 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-07 15:32:26 +00:00
Andrew Nacin e8e569ccd2 Unslash early, directly on the superglobal. see #21767.
git-svn-id: https://develop.svn.wordpress.org/trunk@23576 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 17:57:08 +00:00
Ryan Boren 4088ca8723 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23563 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 17:00:25 +00:00
Ryan Boren c363aea627 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 16:28:40 +00:00
Peter Westwood 79d635459e Revisions: Fix up some half renamed variables that break the view and display a mismash of split and combined views. See #23497 props adamsilverstein.
git-svn-id: https://develop.svn.wordpress.org/trunk@23509 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-28 16:48:33 +00:00
Peter Westwood b1db3a3aa0 Revisions: Fix up some bugs I introduced while reviewing the mega revisions patch - when comparing two historical revisions only one half of the diff would load
See #23497 props adamsilverstein.


git-svn-id: https://develop.svn.wordpress.org/trunk@23508 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-28 16:10:45 +00:00
Peter Westwood 554627a0d5 Revisions: First pass an implementing a new UI/UX for reviewing the revisions of posts. See #23497 props adamsilverstein for the initial patch.
This implements a new revisions ui using Backbone and preserves all the old methods of "integration" so the change should be transparent to plugins using revisi
ons with CPTs.

This is the first pass and so there are a number of things still to be resolved, more details in the ticket. Feedback welcomed.


git-svn-id: https://develop.svn.wordpress.org/trunk@23506 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-28 15:14:34 +00:00
Sergey Biryukov 6a59a28f12 Rename 'no_tagcloud' taxonomy label to 'not_found', for consistency with the post type label of the same key. fixes #23597.
git-svn-id: https://develop.svn.wordpress.org/trunk@23484 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-25 19:39:38 +00:00
Sergey Biryukov 41919e97fb Move 'no_tagcloud' argument to the taxonomy labels object. props DrewAPicture for initial patch. fixes #23597.
git-svn-id: https://develop.svn.wordpress.org/trunk@23483 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-25 18:35:05 +00:00
Andrew Ozz 9b691a21b0 Heartbeat API: add nopriv actions, add JS 'heartbeat-send' event, see #23216
git-svn-id: https://develop.svn.wordpress.org/trunk@23481 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-25 02:32:22 +00:00
Ryan Boren a6c8efadb9 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23416 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-14 22:51:06 +00:00
Andrew Ozz 682b66b560 Heartbeat API: throttle down when the window looses focus or when the user is inactive, always send 'screen_id', change the interval settings to 'fast' (5sec), 'standard' (15sec) and 'slow' (60sec), the interval can be changed from PHP, see #23216
git-svn-id: https://develop.svn.wordpress.org/trunk@23382 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-03 07:03:27 +00:00
Andrew Ozz 5edc6b2711 Heartbeat API: first run, see #23216
git-svn-id: https://develop.svn.wordpress.org/trunk@23355 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-29 06:15:25 +00:00
Andrew Nacin 8175cde11a Ensure we wp_die() at the end of an ajax action. see #23055.
git-svn-id: https://develop.svn.wordpress.org/trunk@23293 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-07 03:59:44 +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 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
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 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 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 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 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
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
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