Commit Graph

559 Commits

Author SHA1 Message Date
Sergey Biryukov
3137e83126 Check if the post type supports title. see #24423.
Built from https://develop.svn.wordpress.org/trunk@25461


git-svn-id: http://core.svn.wordpress.org/trunk@25382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-16 20:51:09 +00:00
Andrew Nacin
737bcf1123 Only focus the title field when it is empty. Remove ancient code that provided for an alternate condition.
props scruffian for initial patches.
props helen.
fixes #24423.

Built from https://develop.svn.wordpress.org/trunk@25459


git-svn-id: http://core.svn.wordpress.org/trunk@25380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-16 20:37:09 +00:00
Ryan Boren
54bf0b713c Don't show the "Get Shortlink" button for pages with a ?page_id=x permalink.
Props sillybean
fixes #14760

Built from https://develop.svn.wordpress.org/trunk@25122


git-svn-id: http://core.svn.wordpress.org/trunk@25102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-26 16:06:08 +00:00
Ryan Boren
564d80e29f wp_get_shortlink() improvements.
* Return shortlinks for pages and public CPTs.
* Return shortlinks even when cruft-free links are not enabled.
* Unit tests

Props sillybean, layotte, cais
fixes #18632
see #14760


Built from https://develop.svn.wordpress.org/trunk@25030


git-svn-id: http://core.svn.wordpress.org/trunk@25017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-15 20:09:09 +00:00
Andrew Nacin
6ed7794598 Restore the revisions meta box for 3.6. Hidden by default as before. Can be useful for a few lingering use cases. see #24804.
git-svn-id: http://core.svn.wordpress.org/trunk@24955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-01 17:06:38 +00:00
Helen Hou-Sandí
43724e7735 Add an edit_form_top hook to the post edit form. props yurivictor. fixes #24861.
git-svn-id: http://core.svn.wordpress.org/trunk@24831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 22:29:36 +00:00
Jon Cave
df3a2bb591 Fix notice and show generic last update message if _edit_last references a nonexistent user.
Fixes #15498.


git-svn-id: http://core.svn.wordpress.org/trunk@24816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 20:35:51 +00:00
Andrew Nacin
c8fe64a602 Revisions changes.
* Eliminates the bloated Revisions meta box in favor of 'Revisions: #' in the publish box.
 * Adds ability to compare autosave to current post, when revisions are disabled.
 * Makes autosaves stand out visually, including "Restore This Autosave".

Also:
 * Adds missing capability check for restoring a revision.
 * When no revision matches the post's current modified time, avoid marking an autosave as 'current'.
 * Fixes wp_get_post_autosave() to return an autosave even when revisions are disabled.
 * Add 'check_enabled' arg to wp_get_post_revisions(); false avoids the wp_revisions_enabled() check.
 * Adds a responsive slider that is narrower for fewer versions. props markjaquith.

see #24804.



git-svn-id: http://core.svn.wordpress.org/trunk@24790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-24 06:08:14 +00:00
Andrew Nacin
85cf232e23 Autosave: Don't save an autosave unnecessarily when the post editor loads and TinyMCE is the default editor.
Delete such useless autosaves when we detect them in edit-form-advanced.php.

see #7392.



git-svn-id: http://core.svn.wordpress.org/trunk@24787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-24 05:37:53 +00:00
Andrew Nacin
c2a543566c Move _local_storage_notice() to admin/includes/template.php. props azaozz, see #24756.
git-svn-id: http://core.svn.wordpress.org/trunk@24762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-22 05:09:49 +00:00
Andrew Nacin
5bb2f20164 Better 'Connection lost' notice that includes an indication of activity. fixes #24695.
git-svn-id: http://core.svn.wordpress.org/trunk@24743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-18 21:33:59 +00:00
Helen Hou-Sandí
a8cb46d9a3 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: http://core.svn.wordpress.org/trunk@24586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-08 15:45:53 +00:00
Andrew Nacin
3231e8cbd0 Pass $post to hooks in edit-form-advanced.php including edit_form_advanced and edit_form_after_*. fixes #24611.
git-svn-id: http://core.svn.wordpress.org/trunk@24446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-19 21:10:51 +00:00
Mark Jaquith
89fd06e44b First pass at removing Post Format UI.
see #24452. fixes #24455.

git-svn-id: http://core.svn.wordpress.org/trunk@24388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-30 21:33:46 +00:00
Sergey Biryukov
8faa6f0260 Fix switching post formats when JavaScript is disabled. props kovshenin. see #24360.
git-svn-id: http://core.svn.wordpress.org/trunk@24373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-27 01:02:10 +00:00
Andrew Ozz
7255abb66c Fix showing and hiding of UI elements when disabling the Post Formats UI, props kovshenin, see #24327
git-svn-id: http://core.svn.wordpress.org/trunk@24264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-15 20:43:09 +00:00
Ryan Boren
164b3e71e6 Update some copy in the Post Formats UI.
see #24227


git-svn-id: http://core.svn.wordpress.org/trunk@24184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-07 13:56:07 +00:00
Sergey Biryukov
3348a6a0ad Avoid an undefined variable notice. fixes #24236.
git-svn-id: http://core.svn.wordpress.org/trunk@24149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-01 02:38:51 +00:00
Sergey Biryukov
d324462cb0 Avoid an undefined variable notice. props sc0ttkclark. see #24236.
git-svn-id: http://core.svn.wordpress.org/trunk@24148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-01 02:27:07 +00:00
Sergey Biryukov
6cf5361850 Remove unused variable and CSS class. see #24046.
git-svn-id: http://core.svn.wordpress.org/trunk@24099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-26 12:36:12 +00:00
Mark Jaquith
1b554db95a 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: http://core.svn.wordpress.org/trunk@24098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-26 12:22:55 +00:00
Sergey Biryukov
57cb2a36bb Avoid an undefined variable notice. props lightningspirit. fixes #24190.
git-svn-id: http://core.svn.wordpress.org/trunk@24097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-25 23:31:20 +00:00
Mark Jaquith
082e067a2d Screen option for Post Format UI.
props nacin. see #23930.

git-svn-id: http://core.svn.wordpress.org/trunk@24092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-25 07:28:33 +00:00
Mark Jaquith
4dffefb166 Fix some issues related to status/aside editor height changing.
props wonderboymusic. fixes #23992.

git-svn-id: http://core.svn.wordpress.org/trunk@24084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-25 04:06:06 +00:00
Mark Jaquith
90fc15e6d9 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: http://core.svn.wordpress.org/trunk@24081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-25 02:44:23 +00:00
Andrew Nacin
874f650a39 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: http://core.svn.wordpress.org/trunk@24063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-22 21:07:42 +00:00
Mark Jaquith
2d382c1a5c 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: http://core.svn.wordpress.org/trunk@24034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-18 18:07:58 +00:00
Andrew Ozz
6573ffa1e1 Revisions: look at the version of the earliest revision when checking whether to upgrade the revisions authors, see #16215
git-svn-id: http://core.svn.wordpress.org/trunk@24026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-18 05:02:57 +00:00
Sergey Biryukov
a1bbc975b4 Make sure the variables are always defined. props tlovett1, danielbachhuber. fixes #24034. fixes #24112.
git-svn-id: http://core.svn.wordpress.org/trunk@24011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-17 15:36:13 +00:00
Mark Jaquith
56d5d62a19 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: http://core.svn.wordpress.org/trunk@24006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-17 04:08:46 +00:00
Sergey Biryukov
4cb9074985 Remove unused variables introduced in [23843]. see #19570.
git-svn-id: http://core.svn.wordpress.org/trunk@23993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-15 18:16:01 +00:00
Ryan Boren
63e67b414b Allow turning off the post formats UI via a show_post_format_ui filter.
Props johnbillion
see #23929


git-svn-id: http://core.svn.wordpress.org/trunk@23946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-09 22:43:28 +00:00
Andrew Ozz
9fe85b154e 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: http://core.svn.wordpress.org/trunk@23929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-06 23:43:05 +00:00
Andrew Ozz
2466f6a726 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: http://core.svn.wordpress.org/trunk@23886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-02 22:51:09 +00:00
Sergey Biryukov
969cf51e6f Fix incorrect script handle and a notice. props ocean90. fixes #23896.
git-svn-id: http://core.svn.wordpress.org/trunk@23868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-29 17:33:35 +00:00
Mark Jaquith
bcc9c61e57 Post Format prompt copy tweaks. props sabreuse. see #19570
git-svn-id: http://core.svn.wordpress.org/trunk@23845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-29 04:19:44 +00:00
Mark Jaquith
c93e0231af 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: http://core.svn.wordpress.org/trunk@23843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-29 03:35:41 +00:00
Mark Jaquith
12d3fc7999 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: http://core.svn.wordpress.org/trunk@23766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-21 04:55:42 +00:00
Helen Hou-Sandí
25c272856b 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: http://core.svn.wordpress.org/trunk@23753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-19 17:18:07 +00:00
Andrew Ozz
e9245269a7 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: http://core.svn.wordpress.org/trunk@23683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-13 10:08:16 +00:00
Andrew Nacin
ebe758b5c6 Use auto-draft rather than post_ID = 0 to detect whether we are adding a new post. see #23665.
git-svn-id: http://core.svn.wordpress.org/trunk@23631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-06 23:55:54 +00:00
Helen Hou-Sandí
fffc2e1ab1 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: http://core.svn.wordpress.org/trunk@23615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-04 23:22:17 +00:00
Ryan Boren
09d2c65970 Always wp_unslash() the return of wp_get_referer().
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:20:32 +00:00
Ryan Boren
5f809d1d22 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:00:25 +00:00
Ryan Boren
43a7e695e9 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: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Peter Westwood
9bd192fab3 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: http://core.svn.wordpress.org/trunk@23506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-28 15:14:34 +00:00
Helen Hou-Sandí
b63559cc89 Prevent a notice for post types that don't support post formats. props ethitter. fixes #23534.
git-svn-id: http://core.svn.wordpress.org/trunk@23456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-19 20:54:03 +00:00
Helen Hou-Sandí
ad85d07189 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: http://core.svn.wordpress.org/trunk@23449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-18 19:11:24 +00:00
Ryan Boren
cc5ed3a485 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: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Mark Jaquith
dab5a6ef7d 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: http://core.svn.wordpress.org/trunk@23395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 18:30:09 +00:00