Display post formats in the posts list table.

props nacin, garyc40, DrewAPicture, wonderboymusic, aaroncampbell.

fixes #16047

git-svn-id: https://develop.svn.wordpress.org/trunk@23392 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-02-08 16:10:05 +00:00
parent 5dd8a15b26
commit 2f6d3fed8c
2 changed files with 14 additions and 2 deletions

View File

@ -259,6 +259,9 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( post_type_supports( $post_type, 'author' ) )
$posts_columns['author'] = __( 'Author' );
if ( post_type_supports( $post_type, 'post-formats' ) )
$posts_columns['format'] = _x( 'Format', 'post format' );
$taxonomies = array();
$taxonomies = get_object_taxonomies( $post_type, 'objects' );
@ -646,6 +649,17 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php
break;
case 'format':
?>
<td <?php echo $attributes ?>><?php
if ( get_post_format( $post->ID ) )
echo get_post_format_string( get_post_format( $post->ID ) );
else
echo get_post_format_string( 'standard' );
?></td>
<?php
break;
default:
if ( 'categories' == $column_name )
$taxonomy = 'category';

View File

@ -1449,8 +1449,6 @@ function _post_states($post) {
}
}
if ( get_post_format( $post->ID ) )
echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
}
function _media_states( $post ) {