Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#15934 closed defect (bug) (fixed)

Sticky post count also count posts in trash

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

Description

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 16 years ago.
there's a patch for that

Download all attachments as: .zip

Change History (5)

@garyc40
16 years ago

there's a patch for that

#1 @nacin
16 years ago

  • Milestone Awaiting Review → 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
16 years ago

  • Keywords has-patch commit added

#3 @westi
16 years ago

  • Keywords dev-reviewed added

Looks great - good find and patch

#4 @nacin
16 years ago

  • Resolution → fixed
  • Status new → 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.