Display post formats in the posts list table.

props nacin, garyc40, DrewAPicture, wonderboymusic, aaroncampbell.

fixes #16047

git-svn-id: http://core.svn.wordpress.org/trunk@23392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-02-08 16:10:05 +00:00
parent b40f37808b
commit 2fb915f860
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 ) {