Commit Graph

548 Commits

Author SHA1 Message Date
Helen Hou-Sandi 8669be7094 Remove the conditional wrappers for the `edit_form_after_*` hooks. Using the `.edit-form-section` class will still add a 20px bottom margin; devs will just want to add wrapping containers as appropriate. fixes #24334; see #23240.
git-svn-id: https://develop.svn.wordpress.org/trunk@24586 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-08 15:45:53 +00:00
Andrew Nacin 165d0971fe Pass $post to hooks in edit-form-advanced.php including edit_form_advanced and edit_form_after_*. fixes #24611.
git-svn-id: https://develop.svn.wordpress.org/trunk@24446 602fd350-edb4-49c9-b593-d223f7449a82
2013-06-19 21:10:51 +00:00
Mark Jaquith e0a0e46abd First pass at removing Post Format UI.
see #24452. fixes #24455.

git-svn-id: https://develop.svn.wordpress.org/trunk@24388 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-30 21:33:46 +00:00
Sergey Biryukov cc2f18445e Fix switching post formats when JavaScript is disabled. props kovshenin. see #24360.
git-svn-id: https://develop.svn.wordpress.org/trunk@24373 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-27 01:02:10 +00:00
Andrew Ozz 22b2023e4b Fix showing and hiding of UI elements when disabling the Post Formats UI, props kovshenin, see #24327
git-svn-id: https://develop.svn.wordpress.org/trunk@24264 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-15 20:43:09 +00:00
Ryan Boren 63c3307f28 Update some copy in the Post Formats UI.
see #24227


git-svn-id: https://develop.svn.wordpress.org/trunk@24184 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-07 13:56:07 +00:00
Sergey Biryukov e0928bb6eb Avoid an undefined variable notice. fixes #24236.
git-svn-id: https://develop.svn.wordpress.org/trunk@24149 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-01 02:38:51 +00:00
Sergey Biryukov dfc7de0306 Avoid an undefined variable notice. props sc0ttkclark. see #24236.
git-svn-id: https://develop.svn.wordpress.org/trunk@24148 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-01 02:27:07 +00:00
Sergey Biryukov af71a8c16d Remove unused variable and CSS class. see #24046.
git-svn-id: https://develop.svn.wordpress.org/trunk@24099 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-26 12:36:12 +00:00
Mark Jaquith 438f4085f1 Post format UI refresh.
* Post format switcher does not go away after clicking
* Refresh of format switcher style
* Highlighting of active post format
* Prompt text goes under the switcher
* Better animations

see #24046. props wonderboymusic, johnjamesjacoby, aaroncampbell, PeteMall.

Also, because I forgot it on [24006]: props saracannon.

git-svn-id: https://develop.svn.wordpress.org/trunk@24098 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-26 12:22:55 +00:00
Sergey Biryukov be43193b61 Avoid an undefined variable notice. props lightningspirit. fixes #24190.
git-svn-id: https://develop.svn.wordpress.org/trunk@24097 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 23:31:20 +00:00
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
Mark Jaquith 4071f758b3 Fix some issues related to status/aside editor height changing.
props wonderboymusic. fixes #23992.

git-svn-id: https://develop.svn.wordpress.org/trunk@24084 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 04:06:06 +00:00
Mark Jaquith 9d531ae545 post-new.php?format=X will pre-fill the format, to allow for Post-Format-chosen-first editor jump-starting.
props kovshenin, wonderboymusic. fixes #24116.

git-svn-id: https://develop.svn.wordpress.org/trunk@24081 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 02:44:23 +00:00
Andrew Nacin 3bbd4cf939 Rename the show_post_format_ui filter to enable_post_format_ui. 'show' is a different concept - this filter entirely disables the UI. see #23929.
git-svn-id: https://develop.svn.wordpress.org/trunk@24063 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-22 21:07:42 +00:00
Mark Jaquith 58ad769e8b Post Formats: use the content body for the body of the Quote post format.
* Searchable, better editing tools
* Less cluttered Post Format UI

props kovshenin, DrewAPicture. see #24009

git-svn-id: https://develop.svn.wordpress.org/trunk@24034 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-18 18:07:58 +00:00
Andrew Ozz 419e62a26d Revisions: look at the version of the earliest revision when checking whether to upgrade the revisions authors, see #16215
git-svn-id: https://develop.svn.wordpress.org/trunk@24026 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-18 05:02:57 +00:00
Sergey Biryukov c6155d6527 Make sure the variables are always defined. props tlovett1, danielbachhuber. fixes #24034. fixes #24112.
git-svn-id: https://develop.svn.wordpress.org/trunk@24011 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 15:36:13 +00:00
Mark Jaquith 793f27f07e New Post Format UI chooser treatment in response to testing.
* Bigger icons
* Format description under each
* UI hides after choice
* Saving without choosing implies "Standard"
* Helpful text, with "Change format" link

see #24046. props lessbloat, wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@24006 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 04:08:46 +00:00
Sergey Biryukov 744b903ec0 Remove unused variables introduced in [23843]. see #19570.
git-svn-id: https://develop.svn.wordpress.org/trunk@23993 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-15 18:16:01 +00:00
Ryan Boren f69b7492e4 Allow turning off the post formats UI via a show_post_format_ui filter.
Props johnbillion
see #23929


git-svn-id: https://develop.svn.wordpress.org/trunk@23946 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-09 22:43:28 +00:00
Andrew Ozz 7c4cebe1c5 Revisions: move the call to _wp_upgrade_revisions_of_post() to edit-form-advanced.php, in the code block checking whether we should show the revisions postbox. See #16215
git-svn-id: https://develop.svn.wordpress.org/trunk@23929 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-06 23:43:05 +00:00
Andrew Ozz 28a928ddb1 Autosave: use heartbeat to determine when connection is lost and disable the Save and Publish buttons. Re-enable the buttons when connection is restored. Props dh-shredder, see #23220
git-svn-id: https://develop.svn.wordpress.org/trunk@23886 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-02 22:51:09 +00:00
Sergey Biryukov 3739c3a14e Fix incorrect script handle and a notice. props ocean90. fixes #23896.
git-svn-id: https://develop.svn.wordpress.org/trunk@23868 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 17:33:35 +00:00
Mark Jaquith 0f9ebf4c63 Post Format prompt copy tweaks. props sabreuse. see #19570
git-svn-id: https://develop.svn.wordpress.org/trunk@23845 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 04:19:44 +00:00
Mark Jaquith e7cde8715f Post Format UI.
* Icons
* Selection
* Prompt text
* Special fields
* Styling
* Sparkles

This is going to need testing, polish, and love.

see #19570. props melchoyce, helen, wonderboymusic, lessbloat, rachelbaker, aaroncampbell, DrewAPicture, ryelle.

git-svn-id: https://develop.svn.wordpress.org/trunk@23843 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 03:35:41 +00:00
Mark Jaquith 53ea4e0566 Add functions for generating metadata for video and audio, using the
ID3 library. Also allows themes/plugins to add thumbnail support
to these media types. Think stuff like album art, movie covers, and
video freeze-frames.

props wonderboymusic. fixes #23673

git-svn-id: https://develop.svn.wordpress.org/trunk@23766 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-21 04:55:42 +00:00
Helen Hou-Sandi 987251f582 Remove separate meta fields for image and gallery post formats. These are proving to be more confusing and labor-intensive from both a user and dev perspective than entering into the regular content editor. We will rely on good content parsing instead. See #19570, #23347.
git-svn-id: https://develop.svn.wordpress.org/trunk@23753 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-19 17:18:07 +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
Andrew Nacin e2fa722fbb Use auto-draft rather than post_ID = 0 to detect whether we are adding a new post. see #23665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23631 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-06 23:55:54 +00:00
Helen Hou-Sandi a847ce2f36 Prevent an unseemly gap on the edit screen when nothing else displays before normal meta boxes. Give better HTML and visual structure to items added via `edit_form_after_title` and `edit_form_after_editor`. Using a class of `.edit-form-section` will now get you a 20px bottom margin; perfect for your additions to the post edit screen. fixes #23240.
git-svn-id: https://develop.svn.wordpress.org/trunk@23615 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-04 23:22:17 +00:00
Ryan Boren 37fae23001 Always wp_unslash() the return of wp_get_referer().
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23570 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 17:20:32 +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 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
Helen Hou-Sandi 6fb8f6a707 Prevent a notice for post types that don't support post formats. props ethitter. fixes #23534.
git-svn-id: https://develop.svn.wordpress.org/trunk@23456 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-19 20:54:03 +00:00
Helen Hou-Sandi 5b3c058bd5 Edit screen UI for post formats: a first run for functionality.
* Adds a very basic tabbed interface for selecting a post format (requires JS).
* Extra fields, which are post meta, are shown/hidden based on the selected format.
* Introduce a helper function for retrieving formats-specific metadata: `get_post_format_meta()`.
* Image selection uses the media modal, although without filtering or from URL support at the moment.

props rachelbaker, wonderboymusic, aaroncampbell, helen. see #19570.


git-svn-id: https://develop.svn.wordpress.org/trunk@23449 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-18 19:11:24 +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
Mark Jaquith e419f6258c Fix some tabbing issues on the post editing screen. Add Media no longer skipped when going backwards from content. Save Draft no longer skipped when going forwards from content.
props adamsilverstein. fixes #23195 and #22933

git-svn-id: https://develop.svn.wordpress.org/trunk@23395 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-08 18:30:09 +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
Ryan Boren 511cb0ec93 Directly access post_status instead of using get_post_status() when checking for auto-draft status. Attachments with their inherit post_status were getting the auto-draft status of their parent when using get_post_status(). This caused some things to display improperly on the edit attachment page.
Props nacin, miqrogroove
fixes #22672


git-svn-id: https://develop.svn.wordpress.org/trunk@22963 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-01 23:12:30 +00:00
Andrew Nacin 8eb663ed3c Media help. props DrewAPicture, merty, Ipstenu. fixes #22451.
git-svn-id: https://develop.svn.wordpress.org/trunk@22925 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-29 17:51:54 +00:00
Andrew Nacin a2535a19b9 No AYS or autosave for attachments on post.php. Reverts part of [22725]. fixes #22491.
git-svn-id: https://develop.svn.wordpress.org/trunk@22858 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-27 02:02:32 +00:00
Ryan Boren 293f8923c4 Consolidate some strings. Props SergeyBiryukov. see #21087
git-svn-id: https://develop.svn.wordpress.org/trunk@22854 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-26 23:12:11 +00:00
Andrew Nacin be4bf5a2aa Updates to post.php help text for posts and pages, including a new section on inserting media. props DrewAPicture, Ipstenu. see #22451.
git-svn-id: https://develop.svn.wordpress.org/trunk@22813 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 09:00:39 +00:00
Andrew Ozz 251ab5e8b1 Fix typo in [22795]
git-svn-id: https://develop.svn.wordpress.org/trunk@22796 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 21:16:19 +00:00
Andrew Ozz f1cdbe4224 Improve AYS comparison on the Edit Attachment screen, props nacin, fixes #22491
git-svn-id: https://develop.svn.wordpress.org/trunk@22795 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 21:11:21 +00:00
Andrew Nacin 79435f42fa Use a variable that is set a few lines up. $post_id is set only in post.php, not post-new.php. fixes #21092.
git-svn-id: https://develop.svn.wordpress.org/trunk@22742 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 09:35:23 +00:00
Andrew Nacin db7dc96921 Media: For pages, use 'Insert into page' rather than 'Insert into post'.
Custom post types can use the media_view_strings filter. No new post type "labels" for now.

see #22712. see #21092 (and #19696).



git-svn-id: https://develop.svn.wordpress.org/trunk@22735 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 23:22:03 +00:00
Andrew Ozz 5e7443ca85 Don't load autosave.js on the attachment editing screen, add simple AYS on unload if there are changes, props helenyhou, fixes #22491
git-svn-id: https://develop.svn.wordpress.org/trunk@22725 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-20 19:46:38 +00:00