diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index d58db752d3..9c3b494043 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -103,17 +103,41 @@ function _cat_row( $category, $level, $name_override = false ) { $category->count = number_format_i18n( $category->count ); $posts_count = ( $category->count > 0 ) ? "$category->count" : $category->count; - $output = " - "; - if ( $default_cat_id != $category->term_id ) { - $output .= ""; - } else { - $output .= " "; + $output = ""; + + $columns = get_column_headers('category'); + $hidden = (array) get_user_option( 'manage-category-columns-hidden' ); + foreach ( $columns as $column_name => $column_display_name ) { + $class = "class=\"$column_name column-$column_name\""; + + $style = ''; + if ( in_array($column_name, $hidden) ) + $style = ' style="display:none;"'; + + $attributes = "$class$style"; + + switch ($column_name) { + case 'cb': + $output .= ""; + if ( $default_cat_id != $category->term_id ) { + $output .= ""; + } else { + $output .= " "; + } + $output .= ''; + break; + case 'name': + $output .= "$edit"; + break; + case 'description': + $output .= "$category->description"; + break; + case 'posts': + $attributes = 'class="posts column-posts num"' . $style; + $output .= "$posts_count\n"; + } } - $output .= " - $edit - $category->description - $posts_count\n\t\n"; + $output .= ''; return apply_filters('cat_row', $output); }