From c1cc5e3153e17b4ee9f86a2272aa7b9d282d1956 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 7 Mar 2019 03:04:50 +0000 Subject: [PATCH] Taxonomy: Add `level-n` classes to rows on edit-tags.php. Props johnjamesjacoby. Fixes #38810. Built from https://develop.svn.wordpress.org/trunk@44804 git-svn-id: http://core.svn.wordpress.org/trunk@44636 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-terms-list-table.php | 9 ++++++++- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 94e419c189..d30fb3d8f8 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -332,7 +332,14 @@ class WP_Terms_List_Table extends WP_List_Table { $this->level = $level; - echo ''; + if ( $tag->parent ) { + $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) ); + $level = 'level-' . $count; + } else { + $level = 'level-0'; + } + + echo ''; $this->single_row_columns( $tag ); echo ''; } diff --git a/wp-includes/version.php b/wp-includes/version.php index c5572a8c92..a03237eaad 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44803'; +$wp_version = '5.2-alpha-44804'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.