I’ve done this with posts, but I can’t find the proper way to reference the category table’s columns.

I’m trying to add a column titled “Image” to the table, so that when the table grid of categories is displayed, if there is a category image assigned to the category, it will appear in the grid.

The first step for me is to determine the proper filter to address in order to insert the columb into the table.

I’ve tried each of these to no avail…

add_filter('manage_categories_columns', 'myFunction', 10, 2);
add_filter('manage_category_columns', 'myFunction', 10, 2);

function myFunction($cat_columns)
{
    $cat_columns['cat_image_thumb'] = 'Image';
    return $cat_columns;
}

3 s
3

The filter is manage_{$screen->id}_columns, and $screen->id is edit-category, giving you manage_edit-category_columns.

I found this by placing a var_dump() in get_column_headers(), which is called by print_column_headers(), which is called in wp-admin/edit-tags.php, the page where you edit the category items.

Leave a Reply

Your email address will not be published. Required fields are marked *