diff --git wp-admin/admin-ajax.php wp-admin/admin-ajax.php
index d2a8d4d..66f03f4 100644
|
|
|
case 'hidden-columns' :
|
| 1036 | 1036 | if ( ! $user = wp_get_current_user() ) |
| 1037 | 1037 | die('-1'); |
| 1038 | 1038 | |
| | 1039 | set_current_screen( $page ); |
| | 1040 | $screen = get_current_screen(); |
| 1039 | 1041 | if ( is_array($hidden) ) |
| 1040 | 1042 | update_user_option($user->ID, "manage{$page}columnshidden", $hidden, true); |
| | 1043 | |
| | 1044 | // show post format column if it's not found in $hidden |
| | 1045 | if ( $screen->base == 'edit' && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) && ! in_array( 'format', $hidden ) && ! get_user_option( "{$screen->id}postformatsshown" ) ) |
| | 1046 | update_user_option( $user->ID, "{$screen->id}postformatsshown", 1 ); |
| 1041 | 1047 | |
| 1042 | 1048 | die('1'); |
| 1043 | 1049 | break; |
diff --git wp-admin/includes/class-wp-posts-list-table.php wp-admin/includes/class-wp-posts-list-table.php
index e623ab5..72388e3 100644
|
|
|
class WP_Posts_List_Table extends WP_List_Table {
|
| 272 | 272 | |
| 273 | 273 | if ( post_type_supports( $post_type, 'author' ) ) |
| 274 | 274 | $posts_columns['author'] = __( 'Author' ); |
| | 275 | |
| | 276 | if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) |
| | 277 | $posts_columns['format'] = _x( 'Format', 'post format' ); |
| 275 | 278 | |
| 276 | 279 | if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'category' ) ) |
| 277 | 280 | $posts_columns['categories'] = __( 'Categories' ); |
| … |
… |
class WP_Posts_List_Table extends WP_List_Table {
|
| 663 | 666 | ?></td> |
| 664 | 667 | <?php |
| 665 | 668 | break; |
| | 669 | |
| | 670 | case 'format': |
| | 671 | ?> |
| | 672 | <td <?php echo $attributes ?>><?php |
| | 673 | if ( get_post_format( $post->ID ) ) |
| | 674 | echo get_post_format_string( get_post_format( $post->ID ) ); |
| | 675 | ?></td> |
| | 676 | <?php |
| | 677 | break; |
| 666 | 678 | |
| 667 | 679 | default: |
| 668 | 680 | ?> |
diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index b345c36..ad455f4 100644
|
|
|
function get_hidden_columns( $screen ) {
|
| 254 | 254 | if ( is_string( $screen ) ) |
| 255 | 255 | $screen = convert_to_screen( $screen ); |
| 256 | 256 | |
| 257 | | return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' ); |
| | 257 | $hidden = (array) get_user_option( 'manage' . $screen->id . 'columnshidden' ); |
| | 258 | |
| | 259 | // post format column is hidden by default |
| | 260 | if ( $screen->base == 'edit' && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) && ! in_array( 'format', $hidden ) && ! get_user_option( "{$screen->id}postformatsshown" ) ) |
| | 261 | $hidden[] = 'format'; |
| | 262 | |
| | 263 | return $hidden; |
| 258 | 264 | } |
| 259 | 265 | |
| 260 | 266 | // adds hidden fields with the data for use in the inline editor for posts and pages |
| … |
… |
function _post_states($post) {
|
| 1646 | 1652 | echo "<span class='post-state'>$state$sep</span>"; |
| 1647 | 1653 | } |
| 1648 | 1654 | } |
| 1649 | | |
| 1650 | | if ( get_post_format( $post->ID ) ) |
| 1651 | | echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>'; |
| 1652 | 1655 | } |
| 1653 | 1656 | |
| 1654 | 1657 | /** |