WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 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:

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

Download all attachments as: .zip

Change History (5)

garyc403 years ago

there's a patch for that

comment:1 nacin3 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.

comment:2 nacin3 years ago

  • Keywords has-patch commit added

comment:3 westi3 years ago

  • Keywords dev-reviewed added

Looks great - good find and patch

comment:4 nacin3 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.