WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18616 closed enhancement (wontfix)

WP_Query Order by Taxonomy

Reported by: justindgivens Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Query Keywords: has-patch needs-testing
Focuses: Cc:

Description

To be able to order by a taxonomy for any post type.

Added:

'orderby' => 'tax'
'tax_name' => 'taxonomy_name'

This way you can sort the post by the Term->name (ASC/DESC) value.

It was something needed in one of my projects and thought the WP community might like it.

Attachments (1)

query.diff (1.7 KB) - added by justindgivens 3 years ago.

Download all attachments as: .zip

Change History (4)

justindgivens3 years ago

comment:1 justindgivens3 years ago

  • Keywords needs-testing added

comment:2 scribu3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks for the patch, but this is not something we want in Core. Here's a thorough explanation from Otto:

http://wordpress.stackexchange.com/questions/14306/using-wp-query-is-it-possible-to-orderby-taxonomy/14309#14309

Last edited 3 years ago by scribu (previous) (diff)

comment:3 justindgivens3 years ago

Scribu, thanks for the quick turn. Also thanks for those articles.

Note: See TracTickets for help on using tickets.