WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13713 closed defect (bug) (wontfix)

get_terms orderby=none and order=DESC don't work together

Reported by: pampfelimetten Owned by:
Milestone: Priority: low
Severity: normal Version: 3.0
Component: Taxonomy Keywords:
Focuses: Cc:

Description

If I want to get a list of terms sorted by the term_id, I use get_terms with the argument orderby=none, but then the order=DESC doesn't apply anymore.

Change History (2)

comment:1 t31os_4 years ago

How can terms be in descending order if you've specified no sort order, ie. orderby=none, if there's nothing to orderby, then it makes perfect sense that the order parameter won't have anything to do (you've told it not to sort).

Please clarify if possible, as it seems to me that's natural and expected behaviour.

comment:2 dd324 years ago

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

I'm inclined to agree here.

If you want to order by the Term ID, you can either set it to an empty string (back-compat) or, preferably, set the orderby to 'id'

This is due to [14563], orderby=none was undefined before, and would simply fallback to ordering by ID. In 3.0, orderby=none has been implemented, as literally, order by nothing, This optimizes queries which can benefit from it.

Note: See TracTickets for help on using tickets.