Ticket #16047: 16047.4.diff

File 16047.4.diff, 2.1 KB (added by DrewAPicture, 3 months ago)

Refresh.

Line 
1Index: wp-admin/includes/class-wp-posts-list-table.php
2===================================================================
3--- wp-admin/includes/class-wp-posts-list-table.php     (revision 23386)
4+++ wp-admin/includes/class-wp-posts-list-table.php     (working copy)
5@@ -258,6 +258,9 @@
6 
7                if ( post_type_supports( $post_type, 'author' ) )
8                        $posts_columns['author'] = __( 'Author' );
9+       
10+               if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
11+                       $posts_columns['format'] = _x( 'Format', 'post format' );
12 
13                $taxonomies = array();
14 
15@@ -645,6 +648,15 @@
16                        ?></td>
17                        <?php
18                        break;
19+                       
20+                       case 'format':
21+                       ?>
22+                       <td <?php echo $attributes ?>><?php
23+                               if ( get_post_format( $post->ID ) )
24+                                               echo get_post_format_string( get_post_format( $post->ID ) );
25+                       ?></td>
26+                       <?php
27+                       break;
28 
29                        default:
30                                if ( 'categories' == $column_name )
31Index: wp-admin/includes/screen.php
32===================================================================
33--- wp-admin/includes/screen.php        (revision 23386)
34+++ wp-admin/includes/screen.php        (working copy)
35@@ -38,7 +38,17 @@
36        if ( is_string( $screen ) )
37                $screen = convert_to_screen( $screen );
38 
39-       return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
40+               $hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );
41+
42+               // Hide columns by default
43+               if ( ! is_array( $hidden ) ) {
44+                       if ( 'edit' == $screen->base && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) )
45+                               $hidden = array( 'format' );
46+
47+                       $hidden = apply_filters('default_hidden_columns', (array) $hidden, $screen);
48+               }
49+
50+               return $hidden;
51 }
52 
53 /**
54Index: wp-admin/includes/template.php
55===================================================================
56--- wp-admin/includes/template.php      (revision 23386)
57+++ wp-admin/includes/template.php      (working copy)
58@@ -1449,8 +1449,6 @@
59                }
60        }
61 
62-       if ( get_post_format( $post->ID ) )
63-               echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
64 }
65 
66 function _media_states( $post ) {