diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 3e682c778c..f6697f13a9 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -292,27 +292,32 @@ class WP_Terms_List_Table extends WP_List_Table { break; } - if ( $term->parent != $parent && empty( $_REQUEST['s'] ) ) { + if ( $term->parent !== $parent && empty( $_REQUEST['s'] ) ) { continue; } // If the page starts in a subtree, print the parents. - if ( $count == $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) { + if ( $count === $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) { $my_parents = array(); $parent_ids = array(); $p = $term->parent; + while ( $p ) { $my_parent = get_term( $p, $taxonomy ); $my_parents[] = $my_parent; $p = $my_parent->parent; + if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops. break; } + $parent_ids[] = $p; } + unset( $parent_ids ); $num_parents = count( $my_parents ); + while ( $my_parent = array_pop( $my_parents ) ) { echo "\t"; $this->single_row( $my_parent, $level - $num_parents ); @@ -474,6 +479,7 @@ class WP_Terms_List_Table extends WP_List_Table { ); $actions = array(); + if ( current_user_can( 'edit_term', $tag->term_id ) ) { $actions['edit'] = sprintf( '%s', @@ -489,6 +495,7 @@ class WP_Terms_List_Table extends WP_List_Table { __( 'Quick Edit' ) ); } + if ( current_user_can( 'delete_term', $tag->term_id ) ) { $actions['delete'] = sprintf( '%s', @@ -498,6 +505,7 @@ class WP_Terms_List_Table extends WP_List_Table { __( 'Delete' ) ); } + if ( is_taxonomy_viewable( $tax ) ) { $actions['view'] = sprintf( '%s', @@ -603,9 +611,11 @@ class WP_Terms_List_Table extends WP_List_Table { */ public function column_links( $tag ) { $count = number_format_i18n( $tag->count ); + if ( $count ) { $count = "$count"; } + return $count; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 27f6b4c99b..f588288138 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50779'; +$wp_version = '5.8-alpha-50780'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.