#38810 closed feature request (fixed)
Add level class to terms list-table rows
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.2 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Taxonomy | Keywords: | 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.
Attachments (1)
Change History (7)
#2
@
9 years ago
- Summary changed from Add level class to terms list-table (to match posts) to Add level class to terms list-table rows
#6
@
7 years ago
- Keywords bulk-reopened added
- Milestone set to 5.2
This seems like a good and straightforward enhancement.
Performance issues were my only initiall concern. But seeing as this arises only on edit-tags.php, performance is less worrisome. Moreover, the way that edit-tags.php is built (top-of-hierarchy, down), the parents fetched by get_term( $term->parent ) should be in the cache in nearly all circumstances.
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.