Skip to content

Instantly share code, notes, and snippets.

//
// 1. Change the field name in line 20 instead of 'thumbnail_id'.
// 2. Change the taxonomy slug in line 30 instead of 'product_tag'.
//
// Display thumbnail in admin column as the second column
function display_custom_tag_thumbnail( $columns ) {
// Insert 'tag-thumbnail' as the second column
$columns_before = array_slice( $columns, 0, 1 ); // Extract the first column
$columns_after = array_slice( $columns, 1 ); // Extract the remaining columns
// Combine columns with 'tag-thumbnail' in the middle