Opened 2 years ago

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

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

Download all attachments as: .zip

Change History (5)

garyc402 years ago

there's a patch for that

  • 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.

  • Keywords has-patch commit added
  • Keywords dev-reviewed added

Looks great - good find and patch

  • 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.