Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#23261 closed enhancement (fixed)

Add include to orderby options for get_terms()

Reported by: wpsmith's profile wpsmith Owned by: boonebgorges's profile boonebgorges
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.4
Component: Taxonomy Keywords: needs-docs
Focuses: Cc:


In light of WordPress 3.5 allowing WP_Query to orderby post__in (#21776, #13729), it would be awesome to have the same functionality for get_terms() and the include argument.

Likewise (#13729), term queries can specify the posts to retrieve by passing an array of term IDs to the include parameter. There is no built in method for sorting those posts by the order specified.

Attachments (2)

23261.patch (2.1 KB) - added by wpsmith 11 years ago.
First pass.
23261.r1.patch (584 bytes) - added by wpsmith 10 years ago.

Download all attachments as: .zip

Change History (9)

11 years ago

First pass.

#1 @boonebgorges
10 years ago

  • Keywords needs-refresh needs-unit-tests added; has-patch removed

Patch looks OK at a glance, but needs a refresh, and unit tests for the new sort order.

10 years ago


#2 @wpsmith
10 years ago

  • Keywords needs-refresh removed
  • Version set to 3.4

#3 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 4.1

wpsmith - Thanks for the refresh.

#4 @johnbillion
10 years ago

  • Keywords needs-unit-tests removed
  • Resolution set to fixed
  • Status changed from new to closed

r30052 missed this ticket.

This ticket was mentioned in Slack in #core by boonebgorges. View the logs.

10 years ago

#6 @DrewAPicture
10 years ago

  • Keywords needs-docs added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Please update the inline docs for the orderby argument to specify that in addition to term fields, 'include' is now accepted and what that means.

#7 @boonebgorges
10 years ago

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

In 30077:

Update inline docs for [30052].

Fixes #23261.

Note: See TracTickets for help on using tickets.