Make WordPress Core

Ticket #16047: 16047.5.diff

File 16047.5.diff, 2.2 KB (added by wonderboymusic, 12 years ago)
  • wp-admin/includes/class-wp-posts-list-table.php

    diff --git wp-admin/includes/class-wp-posts-list-table.php wp-admin/includes/class-wp-posts-list-table.php
    index 0c0231b..4137ee5 100644
    class WP_Posts_List_Table extends WP_List_Table { 
    259259                if ( post_type_supports( $post_type, 'author' ) )
    260260                        $posts_columns['author'] = __( 'Author' );
    261261
     262                if ( post_type_supports( $post_type, 'post-formats' ) )
     263                        $posts_columns['format'] = _x( 'Format', 'post format' );
     264
    262265                $taxonomies = array();
    263266
    264267                $taxonomies = get_object_taxonomies( $post_type, 'objects' );
    class WP_Posts_List_Table extends WP_List_Table { 
    646649                        <?php
    647650                        break;
    648651
     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;
     660
    649661                        default:
    650662                                if ( 'categories' == $column_name )
    651663                                        $taxonomy = 'category';
  • wp-admin/includes/screen.php

    diff --git wp-admin/includes/screen.php wp-admin/includes/screen.php
    index 4a409e8..a8a0502 100644
    function get_hidden_columns( $screen ) { 
    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 && 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

    diff --git wp-admin/includes/template.php wp-admin/includes/template.php
    index b8e45c6..6fb144b 100644
    function _post_states($post) { 
    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 ) {