Make WordPress Core

Ticket #16047: 16047.4.diff

File 16047.4.diff, 2.1 KB (added by DrewAPicture, 12 years ago)

Refresh.

  • wp-admin/includes/class-wp-posts-list-table.php

     
    258258
    259259                if ( post_type_supports( $post_type, 'author' ) )
    260260                        $posts_columns['author'] = __( 'Author' );
     261       
     262                if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
     263                        $posts_columns['format'] = _x( 'Format', 'post format' );
    261264
    262265                $taxonomies = array();
    263266
     
    645648                        ?></td>
    646649                        <?php
    647650                        break;
     651                       
     652                        case 'format':
     653                        ?>
     654                        <td <?php echo $attributes ?>><?php
     655                                if ( get_post_format( $post->ID ) )
     656                                                echo get_post_format_string( get_post_format( $post->ID ) );
     657                        ?></td>
     658                        <?php
     659                        break;
    648660
    649661                        default:
    650662                                if ( 'categories' == $column_name )
  • wp-admin/includes/screen.php

     
    3838        if ( is_string( $screen ) )
    3939                $screen = convert_to_screen( $screen );
    4040
    41         return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
     41                $hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );
     42
     43                // Hide columns by default
     44                if ( ! is_array( $hidden ) ) {
     45                        if ( 'edit' == $screen->base && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) )
     46                                $hidden = array( 'format' );
     47
     48                        $hidden = apply_filters('default_hidden_columns', (array) $hidden, $screen);
     49                }
     50
     51                return $hidden;
    4252}
    4353
    4454/**
  • wp-admin/includes/template.php

     
    14491449                }
    14501450        }
    14511451
    1452         if ( get_post_format( $post->ID ) )
    1453                 echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
    14541452}
    14551453
    14561454function _media_states( $post ) {