Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31364 closed defect (bug) (fixed)

Order By Description does not work in edit-tags.php

Reported by: neil_pie's profile neil_pie Owned by: boonebgorges's profile boonebgorges
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

In WP_Terms_List_Table, 'description' is defined as a sortable column, yet when clicking on the column header in the UI, the table sorts by name instead.

This seems to be because 'description' is missed out of the predefined arguments for the 'orderby' parameter in get_terms(), and so the default orderby of t.name is applied.

This patch adds 'description' as an option, ordering on the tt.descripton field

Attachments (1)

31364.diff (1.5 KB) - added by neil_pie 9 years ago.

Download all attachments as: .zip

Change History (6)

@neil_pie
9 years ago

#1 @neil_pie
9 years ago

  • Keywords has-patch added

Of note - if this patch is accepted, I can change the Codex page for get_terms accordingly

http://codex.wordpress.org/Function_Reference/get_terms

#2 @neil_pie
9 years ago

  • Keywords dev-feedback added

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


9 years ago

#4 @boonebgorges
9 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 4.2

As discussed in Slack:

  • The problem was introduced when edit-tags.php was converted to list tables [15491]. The sorting has therefore never worked properly.
  • There was some question surrounding the question of whether most people would want this data to be sortable. If you are using sentences to describe your terms (as suggested, I think, by the term "description"), it probably doesn't make sense to sort alphabetically by 'description'.
  • That being said, it's easy to imagine ways of using the 'description' field in a way that would make sort-by-description a useful feature, and there's no harm in adding it, so onward we march.

#5 @boonebgorges
9 years ago

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

In 31532:

Add 'orderby=description' support to get_terms().

This fixes an interface inconsistency in edit-tags.php, where Description
appears as a sortable column header.

Props neil_pie.
Fixes #31364.

Note: See TracTickets for help on using tickets.