Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15934 closed defect (bug) (fixed)

Sticky post count also count posts in trash

Reported by: garyc40 Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.1
Component: Administration Keywords: has-patch commit dev-reviewed
Focuses: Cc:


Sticky posts in the trash can are still counted towards the Sticky count in wp-admin/edit.php, but they are not actually displayed in the Sticky list.

Attachments (1)

garyc40-15934.patch (874 bytes) - added by garyc40 11 years ago.
there's a patch for that

Download all attachments as: .zip

Change History (5)

11 years ago

there's a patch for that

#1 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.1

This is the query we're using:

SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND ID IN ($sticky_posts)

The user posts query makes an exception for trash and auto-draft. We shouldn't need to worry about auto-drafts here.

#2 @nacin
11 years ago

  • Keywords has-patch commit added

#3 @westi
11 years ago

  • Keywords dev-reviewed added

Looks great - good find and patch

#4 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17097]) Don't include trash posts in the sticky posts count. props garyc40, fixes #15934.

Note: See TracTickets for help on using tickets.