Commit Graph

323 Commits

Author SHA1 Message Date
Andrew Nacin f3b332e9bb Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226.
git-svn-id: https://develop.svn.wordpress.org/trunk@24593 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-08 20:05:42 +00:00
Andrew Ozz 2700b71b35 Post locks:
- Change from IDs to classes for the notification-dialog divs so they can be reused.
- Do not check post locks if the dialog's html is not present.
- Do not check post locks if there is only one user on a single site install.
See #23697.

git-svn-id: https://develop.svn.wordpress.org/trunk@24304 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-20 19:36:29 +00:00
Sergey Biryukov 1b941a1872 Avoid PHP notices when deleting or restoring an item that no longer exists. props johnbillion, ocean90. fixes #24246.
git-svn-id: https://develop.svn.wordpress.org/trunk@24201 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-08 18:56:54 +00:00
Sergey Biryukov b6bd2d56da Remove unused variables. props ocean90. fixes #24247.
git-svn-id: https://develop.svn.wordpress.org/trunk@24199 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-08 17:52:18 +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
Mark Jaquith 54e229a8b8 Fix a longstanding "off by one" revision authorship bug.
* Fixes old revision data on the fly when you open a post for editing.
* Uses post_name of revisions to store a post version number (-v1), so we know what has been fixed.
* Latest version should also have a revision stored, whereas before it did not.

props adamsilverstein, mdawaffe. fixes #16215.

git-svn-id: https://develop.svn.wordpress.org/trunk@23823 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-27 20:21:38 +00:00
Andrew Ozz 5e71fb3992 Local autosave: set a temp cookie on submitting the form and change it on redirecting after the post is saved/updated, then use it to determine if saving worked properly. Removes the chance for false positives after saving/updating a post. See #23220
git-svn-id: https://develop.svn.wordpress.org/trunk@23693 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-14 03:06:07 +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
Andrew Nacin 780c74d246 Remove unused variables reset by wp_reset_vars(). Many of these haven't been used since b2. see #21767.
git-svn-id: https://develop.svn.wordpress.org/trunk@23445 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-16 18:28:41 +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
Andrew Nacin 991be145a9 Use the regular post type UI for editing single media items (attachments).
* Attachments now go through post.php, edit_post(), the like, and have show_ui set to true.
 * Taxonomies attached to the media library now appear in the admin menu (if show_ui).
 * Editing, cropping, uploading, etc. is still very rough, but mostly functional.

API-wise:
 * New function: get_taxonomies_for_attachments(). Like get_taxonomies(), for taxonomies specifically registered against attachments.
 * Brings taxonomy support from the posts list table to the media list table. Expect them to converge soon.
 * wp_insert_attachment() now handles taxonomies like wp_insert_post(). Also expect them to converge soon.
 * New edit_form_after_title hook.

props helenyhou, ocean90. see #21391.



git-svn-id: https://develop.svn.wordpress.org/trunk@21948 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-21 22:52:54 +00:00
Ryan Boren 01527025c9 Add tags_input, page_template, and post_category get magic to WP_Post.
Deprecate get_post_to_edit() and wp_get_single_post().
Props scribu
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21651 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-28 19:08:28 +00:00
Ryan Boren de06b81360 Remove return ref from all calls to get_post()
Return WP_Post from get_default_post_to_edit()
Replace all calls to get_page() with get_post()
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21597 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-23 20:01:10 +00:00
Ryan Boren 4974f5f233 Remove post type from post nonces. Fixes attachment deletion when EMPTY_TRASH_DAYS is 0. Props c3mdigital, kurtpayne, SergeyBiryukov. fixes #21194
git-svn-id: https://develop.svn.wordpress.org/trunk@21504 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-14 18:39:15 +00:00
Jon Cave 858ba1fabd Check that $post_type_object exists before accessing its properties. Props markoheijnen. Fixes #20064.
git-svn-id: https://develop.svn.wordpress.org/trunk@20623 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-27 19:32:32 +00:00
Ryan Boren 2b186b0c45 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: https://develop.svn.wordpress.org/trunk@19712 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-08 17:01:11 +00:00
Ryan Boren 9356ce2a74 Fix edit.php row action redirects when referrers are not sent. Return false from wp_get_referer() when no referrer found. Props mitchoyoshitaka. fixes #17628
git-svn-id: https://develop.svn.wordpress.org/trunk@19272 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-14 16:59:45 +00:00
Andrew Nacin a5c6da9a2e Move from quickpress_post_ID to post_ID. fixes #19095.
git-svn-id: https://develop.svn.wordpress.org/trunk@19093 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-31 17:08:36 +00:00
Andrew Nacin cc5f01a784 Move WP_Screen to a full registry. Have convert_to_screen() return a WP_Screen object. Improve and verify values for post_type and taxonomy. see #18785. also fixes #14886.
git-svn-id: https://develop.svn.wordpress.org/trunk@19052 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-24 18:34:08 +00:00
Andrew Nacin 35edc4264d Release a user's post lock when the user leaves a post. see #18515.
git-svn-id: https://develop.svn.wordpress.org/trunk@18796 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-27 20:52:07 +00:00
Mark Jaquith 414d10d316 Add New links when editing content. fixes #17499
git-svn-id: https://develop.svn.wordpress.org/trunk@17962 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-19 01:34:34 +00:00
Andrew Nacin 28a5ec7c1c Don't load the QuickPress widget via XHR. see #16927. Reverts [16725] as it's no longer needed. Reverts part of [14815], which introduced the behavior, see #10917.
git-svn-id: https://develop.svn.wordpress.org/trunk@17743 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-28 12:02:24 +00:00
Ryan Boren eba71eb7c0 Bring out the shears.
git-svn-id: https://develop.svn.wordpress.org/trunk@17228 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-06 04:11:14 +00:00
Peter Westwood 432bd4bdae Ensure the Parent menu is hilighted correctly when Custom Post Types are shown under an existing top level menu. Fixes #16015 props duck_.
git-svn-id: https://develop.svn.wordpress.org/trunk@17169 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-29 16:25:22 +00:00
Andrew Nacin 3ebb27ae3e Always exit after wp_redirect. props filosofo, fixes #15518.
git-svn-id: https://develop.svn.wordpress.org/trunk@16847 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-09 18:02:54 +00:00
Dion Hulse 82443ce769 Use Absolute URL's & API's in header redirects in more locations. See #14062
git-svn-id: https://develop.svn.wordpress.org/trunk@16008 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-27 10:43:43 +00:00
Andrew Nacin 92bf5ec246 Remove wp-admin/sidebar.php. fixes #15164.
git-svn-id: https://develop.svn.wordpress.org/trunk@15857 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-20 09:58:21 +00:00
Peter Westwood ca3fead69d Ensure that QuickPress media uploads get attached to the auto-draft we create for new posts correctly. Fixes #10917 props ocean90.
git-svn-id: https://develop.svn.wordpress.org/trunk@14815 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-23 07:58:06 +00:00
Andrew Nacin 323342deec Move post type object capabilities to a 'cap' object. Allow them to be initialized via the 'capabilities' key (an array) when registering support for the post type. Caps are now referred to by the name of the cap as if it was a post, i.e. ->cap->edit_post. see #13358.
git-svn-id: https://develop.svn.wordpress.org/trunk@14585 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-12 20:45:18 +00:00
Nikolay Bachiyski ad3881470e I18n for custom post type labels. Props demetris, dimadin. Fixes #12968
git-svn-id: https://develop.svn.wordpress.org/trunk@14571 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-11 19:52:50 +00:00
Nikolay Bachiyski 0cab071f77 Trash should always be in titlecase for consistency
git-svn-id: https://develop.svn.wordpress.org/trunk@14167 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-20 14:54:36 +00:00
Andrew Nacin ec4f5b83bf Use relative paths when including files, avoiding include_path. fixes #12594, props sorich87.
git-svn-id: https://develop.svn.wordpress.org/trunk@14139 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-18 06:14:45 +00:00
Andrew Nacin e3e9a8e5c8 Don't enqueue unnecessary scripts when the post type doesn't support the editor. fixes #12590, props scribu, _duck.
git-svn-id: https://develop.svn.wordpress.org/trunk@14107 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-16 14:03:48 +00:00
Dion Hulse 468d0d7cff Variable Cleanup, Unused variables, Typo'd variables, unused code blocks. Fixes #12299
git-svn-id: https://develop.svn.wordpress.org/trunk@13242 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-20 02:01:46 +00:00
Dion Hulse 4b66bf7c74 Introduce 'singular_label' for Post Types. Props scribu. See #12214
git-svn-id: https://develop.svn.wordpress.org/trunk@13101 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-13 08:56:38 +00:00
Ryan Boren 12c49c44f4 Allow customizing capabilities for custom post types. Always check caps against those in the post type object instead of contructing them manually. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12927 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-02 17:37:03 +00:00
Mark Jaquith ba857dbae9 Include post_type= when redirecting after "Trash" click from item individual edit screen, to avoid going to Post edit screen for other post_types
git-svn-id: https://develop.svn.wordpress.org/trunk@12820 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-24 20:50:50 +00:00
Ryan Boren b74bea8a2c Merge edit-pages.php into edit.php. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12728 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-15 16:58:36 +00:00
Ryan Boren 9b510ecec4 Merge page.php into post.php. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12708 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-12 16:50:37 +00:00
Ryan Boren 9ef2cb198f More custom post type support. Props scribu. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12597 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-04 16:58:43 +00:00
Andrew Ozz 770fd776d7 Disable trash for attachments for now pending improvements in 3.0, fixes #11149
git-svn-id: https://develop.svn.wordpress.org/trunk@12377 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-12 06:40:16 +00:00
Andrew Ozz ad34368ba9 Fix multiple confirmation messages when restoring posts and pages from the trash, props caesarsgrunt, see #4529
git-svn-id: https://develop.svn.wordpress.org/trunk@12312 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-01 23:28:20 +00:00
Peter Westwood b9b969f12a Allow plugins to change the redirect on post/page publishing/submitting. Fixes #10929 props johnjosephbachir and johnbillion.
git-svn-id: https://develop.svn.wordpress.org/trunk@12260 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-22 22:30:27 +00:00
Andrew Ozz 4bf4ab5114 Fix warning when trashing a post from the write screen, fixes #11131
git-svn-id: https://develop.svn.wordpress.org/trunk@12182 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-13 03:47:10 +00:00
Andrew Ozz b86ab00920 Undo for posts, pages and media, props caesarsgrunt, see #4529
git-svn-id: https://develop.svn.wordpress.org/trunk@12121 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-28 02:46:08 +00:00
Andrew Ozz 0c847d8256 Pull thumbnail scripts out of Posts screens too. see #10928
git-svn-id: https://develop.svn.wordpress.org/trunk@12065 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-19 21:51:16 +00:00
Andrew Ozz aaae110d8f Remove remains from the old bookmarklet code
git-svn-id: https://develop.svn.wordpress.org/trunk@12029 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-14 05:53:49 +00:00
Andrew Ozz 2dc1de999c Open View/Preview post in a new window from the link in the Saved/Updated message, cleanup messages code, add Draft updated for Pages.
git-svn-id: https://develop.svn.wordpress.org/trunk@12020 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-11 00:37:26 +00:00
Andrew Ozz cfad60032c Show "Draft updated" instead of "Post updated" when saving drafts.
git-svn-id: https://develop.svn.wordpress.org/trunk@12017 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-10 07:24:05 +00:00
Mark Jaquith ab98fc356b First pass on canonical post thumbanils. Admin-side GUI only. Theme functions to follow. see #10928
git-svn-id: https://develop.svn.wordpress.org/trunk@12007 602fd350-edb4-49c9-b593-d223f7449a82
2009-10-07 22:18:09 +00:00