Commit Graph

3830 Commits

Author SHA1 Message Date
Sergey Biryukov
b5c34dc411 Fix typo in phpdoc. see #17515.
git-svn-id: http://core.svn.wordpress.org/trunk@23457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-19 23:40: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
Andrew Nacin
83e0ce2ac1 Remove unused variables reset by wp_reset_vars(). Many of these haven't been used since b2. see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@23445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 18:28:41 +00:00
Mark Jaquith
52c46736df Improve the UX of the Nav Menus screen. Kill the tabs, and change to a
dropdown, unless you have zero or one menus (which is the most common),
in which case you jump right into editing your sole menu.

Do assignment to location using checkboxes in the main menu editing
section instead of the backwards menu => location assignment in a
random meta box.

More to come, but this gets us started.

props lessbloat, DrewAPicture, jkudish. see #23119

git-svn-id: http://core.svn.wordpress.org/trunk@23441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 04:53:59 +00:00
Sergey Biryukov
bc2ff9d342 Deprecate wp_convert_bytes_to_hr() in favor of size_format(). props F J Kaiser. fixes #19067.
git-svn-id: http://core.svn.wordpress.org/trunk@23439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 03:07:56 +00:00
Sergey Biryukov
6bcd1665eb Add missing inline descriptions. see #19067.
git-svn-id: http://core.svn.wordpress.org/trunk@23437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-16 02:52:57 +00:00
Sergey Biryukov
34862544fe Correct return value for comment_exists(). fixes #20494.
git-svn-id: http://core.svn.wordpress.org/trunk@23433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-15 18:49:07 +00:00
Sergey Biryukov
2312092aad Allow filtering attachments by Author name in Media Library. props greuben. fixes #16044.
git-svn-id: http://core.svn.wordpress.org/trunk@23430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-15 17:33:28 +00:00
Mark Jaquith
d48d025403 "LGPL License" is redundant.
props wonderboymusic, jakub.tyrcha. fixes #15585

git-svn-id: http://core.svn.wordpress.org/trunk@23425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-15 16:26:46 +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
00dbfdf89e Document the mysterious seventh parameter of add_meta_box().
props wonderboymusic, markjaquith. fixes #17515

git-svn-id: http://core.svn.wordpress.org/trunk@23397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 18:37:34 +00:00
Mark Jaquith
ddd1b94184 Link post formats in posts list table. Use a dash for standard, like we do for absence of tags. see #16047 Next: use icons, not text descriptions.
git-svn-id: http://core.svn.wordpress.org/trunk@23396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 18:34:51 +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
Helen Hou-Sandí
1c816c795b Open external links to plugin homepages, plugin author homepages, and theme author homepages in a new window/tab. props SergeyBiryukov. fixes #20839.
git-svn-id: http://core.svn.wordpress.org/trunk@23394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 16:20:01 +00:00
Mark Jaquith
2fb915f860 Display post formats in the posts list table.
props nacin, garyc40, DrewAPicture, wonderboymusic, aaroncampbell.

fixes #16047

git-svn-id: http://core.svn.wordpress.org/trunk@23392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 16:10:05 +00:00
Andrew Ozz
6c41e93fec 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: http://core.svn.wordpress.org/trunk@23382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-03 07:03:27 +00:00
Andrew Nacin
55ba72f46e Confirm a user exists before deleting them in wp_delete_user() and wpmu_delete_user(). props scribu, fixes #23067.
git-svn-id: http://core.svn.wordpress.org/trunk@23380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-02 04:41:02 +00:00
Sergey Biryukov
2967871d34 Return WP_Error from wp_crop_image() if saving has failed. props macbrink. fixes #23325.
git-svn-id: http://core.svn.wordpress.org/trunk@23374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-02 02:01:59 +00:00
Andrew Nacin
91e3f2b866 Clean up rendering of the title column in the posts list table. Simplify branching. Use get_userdata() rather than get_user_by( 'id' ). Change string to '%s is currently editing'. see #23312.
git-svn-id: http://core.svn.wordpress.org/trunk@23372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-02 01:54:06 +00:00
Andrew Ozz
0674bbfa8a Posts screen: show when a post is "locked", hide the checkbox, Quick Edit and Trash links, props dh-shredder, see #23312
git-svn-id: http://core.svn.wordpress.org/trunk@23371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-02 01:31:06 +00:00
Andrew Ozz
98bf511b56 Heartbeat API: first run, see #23216
git-svn-id: http://core.svn.wordpress.org/trunk@23355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-29 06:15:25 +00:00
Helen Hou-Sandí
28f6c5bcf4 Remove the long-broken and questionably useful [more]/[less] toggle for hierarchical taxonomies in Quick/Bulk Edit. Nobody seems to have noticed in the nearly 3 years it's been broken. fixes #23006
git-svn-id: http://core.svn.wordpress.org/trunk@23354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 22:36:15 +00:00
Sergey Biryukov
72784ad6c2 Consistently use a helper function instead of directly printing the disabled attribute.
Remove an erroneous esc_attr() call.

fixes #23194.

git-svn-id: http://core.svn.wordpress.org/trunk@23352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 03:23:01 +00:00
Sergey Biryukov
3e917ac75f Make sure the post exists before checking its ID. fixes #23026.
git-svn-id: http://core.svn.wordpress.org/trunk@23351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 02:55:06 +00:00
Sergey Biryukov
3d8a1289d2 Add missing inline descriptions.
props momo360modena, aaronholbrook.
see #20494, fixes #23304.

git-svn-id: http://core.svn.wordpress.org/trunk@23350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 02:20:47 +00:00
Sergey Biryukov
428e9baba7 Correct return value for WP_Filesystem_Base::gethchmod(). props bananastalktome. fixes #23121.
git-svn-id: http://core.svn.wordpress.org/trunk@23349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 01:55:39 +00:00
Dion Hulse
33d913220b Core Update: Fix a issue which caused automatic upgrades from 2.7 to 3.5+ to fail. Pre-2.7 WP_Filesystem::wp_content_dir() returned unslashed paths. Introduced in [22227]. See #23177
git-svn-id: http://core.svn.wordpress.org/trunk@23297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-11 10:16:45 +00:00
Andrew Nacin
1fa8476425 Ensure we wp_die() at the end of an ajax action. see #23055.
git-svn-id: http://core.svn.wordpress.org/trunk@23293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-07 03:59:44 +00:00
Andrew Nacin
5d980a8e8e Whenever we have compat fields to render, send a dummy menu_order field (which was always sent in 3.4) to ensure an unchecked checkbox can still be processed by attachment_fields_to_save. fixes #22868.
git-svn-id: http://core.svn.wordpress.org/trunk@23290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-05 03:50:28 +00:00
Peter Westwood
f683fc7677 Tighten our braces. Fixes #23118 props evansolomon.
git-svn-id: http://core.svn.wordpress.org/trunk@23265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 10:13:51 +00:00
Dion Hulse
9f6638747d Upgrade: When upgrading from WordPress 3.5, if an empty twentytwelve theme directory exists, remove it to allow the installation of Twenty Twelve. See #22856. For trunk
git-svn-id: http://core.svn.wordpress.org/trunk@23253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-03 07:42:16 +00:00
Andrew Nacin
f0a8acc6b6 Don't stomp existing sizes inside wp_save_image().
props markoheijnen.
see #22985.
for trunk.



git-svn-id: http://core.svn.wordpress.org/trunk@23246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-03 05:23:36 +00:00
Andrew Nacin
5491a56363 Remove deleted files on upgrade, including wp-app.php and class-wp-atom-server.php.
props duck_
see #22855
for trunk



git-svn-id: http://core.svn.wordpress.org/trunk@23203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-26 20:34:30 +00:00
Helen Hou-Sandí
b1f1579604 its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665.
git-svn-id: http://core.svn.wordpress.org/trunk@23191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-20 15:55:32 +00:00
Dion Hulse
39a19e1d76 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: http://core.svn.wordpress.org/trunk@23179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-15 03:09:50 +00:00
Andrew Nacin
de3a5b8694 Use 3 * HOUR_IN_SECONDS rather than 10800.
git-svn-id: http://core.svn.wordpress.org/trunk@23175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-12 07:30:28 +00:00
Andrew Nacin
cfe6e9ed09 Rip keyboard shortcuts out of the image editor help. props helenyhou. fixes #22786.
git-svn-id: http://core.svn.wordpress.org/trunk@23106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 09:21:27 +00:00
Mark Jaquith
1419b404a8 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: http://core.svn.wordpress.org/trunk@23095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 05:52:19 +00:00
Mark Jaquith
68524f7c6f 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: http://core.svn.wordpress.org/trunk@23094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 05:34:17 +00:00
Andrew Nacin
08401b9e3c 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: http://core.svn.wordpress.org/trunk@23088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 03:50:31 +00:00
Daryl Koopersmith
8efc323e2e Add hidden fields via attachment_fields_to_edit to the existing compat output. props nacin. fixes #22769.
git-svn-id: http://core.svn.wordpress.org/trunk@23086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 03:28:21 +00:00
Andrew Nacin
173806d7a1 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: http://core.svn.wordpress.org/trunk@23083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-06 00:41:06 +00:00
Andrew Nacin
a13a011265 Translate the 'First Steps with WordPress' Codex link. props SergeyBiryukov, fixes #22767.
git-svn-id: http://core.svn.wordpress.org/trunk@23082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 22:51:24 +00:00
Andrew Nacin
ce11438e77 Media list table: Fix the categories column, hidden thanks to a typo. props eddiemoya, fixes #22764. see #21240, #21391.
git-svn-id: http://core.svn.wordpress.org/trunk@23081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 22:49:51 +00:00
Mark Jaquith
bc8ddb3e64 Intelligently make media fields readonly when the user cannot update or do anything with them. props koopersmith, helenyhou, nacin. fixes #22613
git-svn-id: http://core.svn.wordpress.org/trunk@23072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 10:29:24 +00:00
Andrew Nacin
40ae89369f 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: http://core.svn.wordpress.org/trunk@23058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-05 02:34:00 +00:00
Andrew Nacin
0bd02ac6bb Use correct button class hierarchy to ensure the 'Update' button is button-large. see #21598.
git-svn-id: http://core.svn.wordpress.org/trunk@23044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 22:02:25 +00:00
Ryan Boren
a200c702e0 Only show Delete in media modal if the user can delete.
Props nacin, koopersmith
fixes #22711


git-svn-id: http://core.svn.wordpress.org/trunk@23032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-04 18:33:51 +00:00
Ryan Boren
63662a9b7b In the QuickPress media modal, use the new post id when a post is published.
Props nacin, koopersmith
fixes #22673


git-svn-id: http://core.svn.wordpress.org/trunk@22994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 07:17:10 +00:00
Andrew Nacin
5d0933d884 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: http://core.svn.wordpress.org/trunk@22979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 02:38:10 +00:00