WordPress.org

Make WordPress Core

Changeset 23392


Ignore:
Timestamp:
02/08/2013 04:10:05 PM (8 years ago)
Author:
markjaquith
Message:

Display post formats in the posts list table.

props nacin, garyc40, DrewAPicture, wonderboymusic, aaroncampbell.

fixes #16047

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r23372 r23392  
    259259        if ( post_type_supports( $post_type, 'author' ) )
    260260            $posts_columns['author'] = __( 'Author' );
     261
     262        if ( post_type_supports( $post_type, 'post-formats' ) )
     263            $posts_columns['format'] = _x( 'Format', 'post format' );
    261264
    262265        $taxonomies = array();
     
    643646                    get_the_author()
    644647                );
     648            ?></td>
     649            <?php
     650            break;
     651
     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                else
     658                    echo get_post_format_string( 'standard' );
    645659            ?></td>
    646660            <?php
  • trunk/wp-admin/includes/template.php

    r23352 r23392  
    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
Note: See TracChangeset for help on using the changeset viewer.