Make WordPress Core


Ignore:
Timestamp:
03/07/2019 03:03:57 AM (8 years ago)
Author:
boonebgorges
Message:

Taxonomy: Add level-n classes to rows on edit-tags.php.

Props johnjamesjacoby.
Fixes #38810.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r43571 r44804  
    333333                $this->level = $level;
    334334
    335                 echo '<tr id="tag-' . $tag->term_id . '">';
     335                if ( $tag->parent ) {
     336                        $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
     337                        $level = 'level-' . $count;
     338                } else {
     339                        $level = 'level-0';
     340                }
     341
     342                echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
    336343                $this->single_row_columns( $tag );
    337344                echo '</tr>';
Note: See TracChangeset for help on using the changeset viewer.