microtag
2/24/2017 - 1:52 PM

Aggiungere featured image to column admin Aggiungere immagine evidenza in colonna di amministrazione From http://wordpress.stackexchange.com

Aggiungere featured image to column admin Aggiungere immagine evidenza in colonna di amministrazione From http://wordpress.stackexchange.com/questions/111183/post-featured-image-column-on-admin-post-list-page

function custom_columns( $columns ) {
    $columns = array(
        'cb' => '<input type="checkbox" />',
        'featured_image' => 'Image',
        'title' => 'Title',
        'comments' => '<span class="vers"><div title="Comments" class="comment-grey-bubble"></div></span>',
        'date' => 'Date'
     );
    return $columns;
}
add_filter('manage_posts_columns' , 'custom_columns');

function custom_columns_data( $column, $post_id ) {
    switch ( $column ) {
    case 'featured_image':
        echo the_post_thumbnail( 'thumbnail' );
        break;
    }
}
add_action( 'manage_posts_custom_column' , 'custom_columns_data', 10, 2 );