Make WordPress Core


Ignore:
Timestamp:
09/11/2008 05:36:34 AM (17 years ago)
Author:
ryan
Message:

Column hiding for pages. see #7725

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r8858 r8860  
    892892    $class = ('alternate' == $class ) ? '' : 'alternate';
    893893    $posts_columns = wp_manage_pages_columns();
     894    $hidden = (array) get_user_option( 'manage-page-columns-hidden' );
    894895    $title = get_the_title();
    895896    if ( empty($title) )
     
    902903
    903904foreach ($posts_columns as $column_name=>$column_display_name) {
     905    $class = "class=\"$column_name column-$column_name\"";
     906
     907    $style = '';
     908    if ( in_array($column_name, $hidden) )
     909        $style = ' style="display:none;"';
     910
     911    $attributes = "$class$style";
    904912
    905913    switch ($column_name) {
     
    912920    case 'modified':
    913921    case 'date':
     922        $attributes = 'class="date column-date"' . $style;
    914923        if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) {
    915924            $t_time = $h_time = __('Unpublished');
     
    934943        }
    935944        ?>
    936         <td class="date"><abbr title="<?php echo $t_time ?>"><?php echo $h_time ?></abbr></td>
     945        <td <?php echo $attributes ?>><abbr title="<?php echo $t_time ?>"><?php echo $h_time ?></abbr></td>
    937946        <?php
    938947        break;
    939948    case 'title':
     949        $attributes = 'class="post-title page-title column-title"' . $style;
    940950        $edit_link = get_edit_post_link( $page->ID );
    941951        ?>
    942         <td class="post-title"><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; } ?></strong>
     952        <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; } ?></strong>
    943953        <?php
    944954        if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); }
    945 
    946         if ( 'excerpt' == $mode )
    947             the_excerpt();
    948955
    949956        $actions = array();
     
    964971
    965972    case 'comments':
    966         ?>
    967         <td class="comments num"><div class="post-com-count-wrapper">
     973        $attributes = 'class="comments column-comments num"' . $style;
     974        ?>
     975        <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
    968976        <?php
    969977        $left = get_pending_comments_num( $page->ID );
     
    981989    case 'author':
    982990        ?>
    983         <td class="author"><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
     991        <td <?php echo $attributes ?>><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
    984992        <?php
    985993        break;
     
    987995    case 'status':
    988996        ?>
    989         <td class="status">
     997        <td <?php echo $attributes ?>>
    990998        <a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">
    991999        <?php
Note: See TracChangeset for help on using the changeset viewer.