How can I view all WP generated thumbnails in Media Manager?

Notice:

I’m considering that by Media Manager you’re referring to the Media Library.

/wp-admin/media.php

Maybe pre_get_posts could handle this, but won’t get there…

I’d propose an alternative solution that prevents seeing lots of duplicates in the Media Library page:

enter image description here

The output of the All Thumbs column is simply a link to the image.
But I think it can be easily adapted to include at least a delete capability, using some PHP script.

It could also be coupled with jQuery behavior control and CSS styling…

if( is_admin() )
{
    add_filter( 'manage_upload_columns', 'wpse_7757_all_thumbs_column_register' );
    add_action( 'manage_media_custom_column', 'wpse_7757_all_thumbs_columns_display', 10, 2 );
}

function wpse_7757_all_thumbs_column_register( $columns ) 
{
    $columns['all_thumbs'] = 'All Thumbs';

    return $columns;
}

function wpse_7757_all_thumbs_columns_display( $column_name, $post_id ) 
{
    if( 'all_thumbs' != $column_name || !wp_attachment_is_image($post_id) )
        return;

    $full_size = wp_get_attachment_image_src( $post_id, 'full' );
    echo '<div style="clear:both">FULL SIZE : '.$full_size[1].' x '.$full_size[2].'</div>';

    $size_names = get_intermediate_image_sizes();

    foreach( $size_names as $name )
    {
        // CHECK THIS: http://wordpress.org/support/topic/wp_get_attachment_image_src-problem
        $the_list = wp_get_attachment_image_src( $post_id, $name );

        if ( $the_list[3] )
            echo '<div style="clear:both"><a href="'.$the_list[0].'" target="_blank">'.$name.'</a> : '.$the_list[1].' x '.$the_list[2].'</div>';
    }
}

Leave a Comment