How to add custom columns to Custom Post Type admin screen

The code from ThinkVitamin is right. I think the problem came from else where in your code.

Actually, the hook manage_edit-${post_type}_columns takes an argument $columns which is an array of all registered columns. To add a new column, just add a new element to this array, like this:

add_filter('manage_edit-film_columns', 'my_columns');
function my_columns($columns) {
    $columns['views'] = 'Views';
    return $columns;
}

Leave a Comment