WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#23261 closed enhancement (fixed)

Add include to orderby options for get_terms()

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

Description

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 8 years ago.
First pass.
23261.r1.patch (584 bytes) - added by wpsmith 7 years ago.
Refreshed

Download all attachments as: .zip

Change History (9)

@wpsmith
8 years ago

First pass.

#1 @boonebgorges
7 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.

@wpsmith
7 years ago

Refreshed

#2 @wpsmith
7 years ago

  • Keywords needs-refresh removed
  • Version set to 3.4

#3 @boonebgorges
7 years ago

  • Milestone changed from Awaiting Review to 4.1

wpsmith - Thanks for the refresh.

#4 @johnbillion
7 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.


7 years ago

#6 @DrewAPicture
7 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
7 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.