Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11037 closed enhancement (fixed)

orderby does not support ordering by comment_count

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Query Keywords:
Focuses: Cc:

Description

WP_Query does not appear to support ordering by comment_count. We should add that to the whitelist.

Attachments (1)

orderby_comment_count.diff (349 bytes) - added by nickohrn 14 years ago.
Patch that fixes order by comment_count breakage.

Download all attachments as: .zip

Change History (6)

#1 @scribu
14 years ago

  • Milestone changed from Unassigned to Future Release
  • Type changed from defect (bug) to enhancement

#2 @markjaquith
14 years ago

  • Milestone changed from Future Release to 2.9
  • Owner changed from ryan to markjaquith
  • Status changed from new to accepted

#3 @markjaquith
14 years ago

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

(In [12127]) Allow ordering by comment_count. fixes #11037

@nickohrn
14 years ago

Patch that fixes order by comment_count breakage.

#4 @nickohrn
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Your commit failed to include a break, so ordering by comment_count would cause an order on a non existent field such as wp_posts.wp_posts.comment_count. Please find a patch attached.

#5 @markjaquith
14 years ago

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

(In [12146]) Add missing break. props nickohrn. fixes #11037

Note: See TracTickets for help on using tickets.