nasıl bildiğim tek yol, kendi sütun dizinizi oluşturmaktır.
// Add to admin_init function
add_filter('manage_edit-au-gallery_columns', 'add_my_gallery_columns');
function add_my_gallery_columns($gallery_columns) {
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['id'] = __('ID');
$new_columns['title'] = _x('Gallery Name', 'column name');
// your new column somewhere good in the middle
$new_columns['thumbnail'] = __('Thumbnail');
$new_columns['categories'] = __('Categories');
$new_columns['tags'] = __('Tags');
$new_columns['date'] = _x('Date', 'column name');
return $new_columns;
}
ve normalde yaptığınız gibi bu fazladan eklenen sütunları işleyin
// Add to admin_init function
add_action('manage_au-gallery_posts_custom_column', 'manage_gallery_columns', 10, 2);
function manage_gallery_columns($column_name, $id) {
global $wpdb;
switch ($column_name) {
case 'id':
echo $id;
break;
case 'Thumbnail':
$thumbnail_id = get_post_meta( $id, '_thumbnail_id', true );
// image from gallery
$attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );
if ($thumbnail_id)
$thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );
elseif ($attachments) {
foreach ( $attachments as $attachment_id => $attachment ) {
$thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );
}
}
if ( isset($thumb) && $thumb ) {echo $thumb; } else {echo __('None');}
break;
default:
break;
} // end switch
}
Bu yardımcı olur umarım