Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#13031 closed defect (bug) (fixed)

Latest nightly, slight bug in query.php when using post_status = 'any'

Reported by: aesqe Owned by: ryan
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Query Keywords:
Focuses: Cc:


on line 2205

foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )

shouldn't the value of 'exclude_from_search' be false?

i noticed that no attachments are being shown in add media -> gallery, and i've tracked the problem to the line above.

Change History (4)

#1 @aesqe
12 years ago

  • Cc aesqe@… added

#2 @dd32
12 years ago

  • Status changed from new to reviewing

This would've been caused by [14086] Register 'inherit' as a post status. Check the parent post status when commenting on attachments.

Assigning to ryan for review since it was his commit. However, I'll commit what I believe should fix it.

array('exclude_from_search' => true) should be correct, The resulting SQL is:

(wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft' AND wp_posts.post_status <> 'inherit')

Those post stati should be excluded by default, except for inherit.

#3 @dd32
12 years ago

(In [14122]) Do not exclude inherit post_status from query results, Fixes Attachment listing in Gallery tab as well as displaying galleries on the front end (get_children() & friends). See #13031

#4 @dd32
12 years ago

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

Closing as fixed due to no negitive reports from this changeset.

Note: See TracTickets for help on using tickets.