Consolidate column header code. Add column hiding to taxonomy pages (incomplete). see #7725

git-svn-id: https://develop.svn.wordpress.org/trunk@8923 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-09-18 05:41:45 +00:00
parent 47a31f05d0
commit 09cb6eeebb
11 changed files with 194 additions and 107 deletions

View File

@@ -11,27 +11,7 @@ if ( ! defined('ABSPATH') ) die();
<table class="widefat">
<thead>
<tr>
<?php
$posts_columns = wp_manage_posts_columns();
$hidden = (array) get_user_option( 'manage-post-columns-hidden' );
foreach ( $posts_columns as $post_column_key => $column_display_name ) {
if ( 'cb' === $post_column_key )
$class = ' class="check-column"';
elseif ( 'comments' === $post_column_key )
$class = ' class="manage-column column-comments num"';
elseif ( 'modified' === $post_column_key )
$class = ' class="manage-column column-date"';
else
$class = " class=\"manage-column column-$post_column_key\"";
$style = '';
if ( in_array($post_column_key, $hidden) )
$style = ' style="display:none;"';
?>
<th scope="col"<?php echo "id=\"$post_column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th>
<?php } ?>
<?php print_column_headers('post'); ?>
</tr>
</thead>
<tbody>