WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#38810 new feature request

Add level class to terms list-table rows

Reported by: johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: 2nd-opinion has-patch
Focuses: administration Cc:

Description

I have a need to style & target taxonomy terms of a certain depth in the terms list table. Posts already includes a level-%d style class, so this should be pretty straight forward.

One caveat is that posts uses get_post_ancestors() (and terms will need to use get_ancestors()) but this comment from @nacin may not apply in exactly the same way.

There also is no get_term_class() function ala get_post_class(), so I'm going to propose a patch for only the single purpose of this ticket vs. aiming for feature parity with posts.

See #25791, r26244. Patch imminent.

Attachments (1)

38810.patch (670 bytes) - added by johnjamesjacoby 20 months ago.

Download all attachments as: .zip

Change History (4)

#1 @johnjamesjacoby
20 months ago

  • Keywords 2nd-opinion has-patch added

#2 @johnjamesjacoby
20 months ago

  • Summary changed from Add level class to terms list-table (to match posts) to Add level class to terms list-table rows

#3 @johnjamesjacoby
20 months ago

For added context, I have this plugin: https://wordpress.org/plugins/wp-term-order/

As is, I cannot target terms within the same branch in the hierarchy, which results in the next/prev/current positions only being based on a flat term relationship. This means when terms are reordered, it reorders the entire view, not just siblings.

The attached patch would allow me to target .level-2, and I could query, rearrange, and redraw only the correct terms.

Note: See TracTickets for help on using tickets.