Opened 11 years ago
Closed 11 years ago
#25127 closed defect (bug) (fixed)
Saving an empty draft sticky post leads to auto-drafts being marked as sticky
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
If you save an empty post set as sticky as draft it increments number of Sticky Posts because the auto-draft's ID ends up in the list of sticky posts:
To reproduce error:
- Create New Post, leave everything empty
- Tick 'Stick this post to the front page'
- Click Save as Draft
Reproduced in a clean install of WordPress v3.6, default theme with no plugins activated.
Attachments (1)
Change History (8)
#2
@
11 years ago
- Component changed from Administration to General
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#4
@
11 years ago
- Description modified (diff)
- Keywords needs-patch added
- Milestone set to 3.7
- Resolution duplicate deleted
- Status changed from closed to reopened
- Summary changed from Missing Empty Posts to Saving an empty draft sticky post leads to auto-drafts being marked as sticky
Re-opening and focusing on the specific different issue from the other tickets and a specific issue which can easily be solved independently.
#5
@
11 years ago
- Cc mario@… added
- Keywords has-patch added; needs-patch removed
The problem is that wp_insert_post
breaks earlier when an empty post has been found and assigned as true to the $maybe_empty
variable. Initially, a post has a status of auto-draft
which isn't updated to draft
unless there is any valid data in the title or content.
IMO this makes sense and also happens when you skip step 2 (i.e. just hit 'Save Draft' for an empty post).
My proposal is just counting the sticky posts properly by ignoring auto-draft
posts as well.
Related: #17115, #23623, #23887.