Custom Taxonomy Meta Admin Column

I managed to work it out. Seems like the filters only work when wrapped in an ‘admin_init’ action. My final code to add an admin column for the custom taxonomy meta ‘front_page’ to the custom taxonomy ‘shopp_department’ in my themes’ functions.php

// Register the column
function department_add_dynamic_hooks() {
$taxonomy = 'shopp_department';
add_filter( 'manage_' . $taxonomy . '_custom_column', 'department_taxonomy_rows',15, 3 );
add_filter( 'manage_edit-' . $taxonomy . '_columns',  'department_taxonomy_columns' );
}
add_action( 'admin_init', 'department_add_dynamic_hooks' );

function department_taxonomy_columns( $original_columns ) {
$new_columns = $original_columns;
array_splice( $new_columns, 1 );
$new_columns['frontpage'] = esc_html__( 'Front Page', 'taxonomy-images' );
return array_merge( $new_columns, $original_columns );
}

function department_taxonomy_rows( $row, $column_name, $term_id ) {
$t_id = $term_id;
$meta = get_option( "taxonomy_$t_id" );
if ( 'frontpage' === $column_name ) {
    if ($meta == true) {
        return $row . 'Yes';
    } else {
        return $row . 'No';
    }   
}

Hope this helps someone.

Leave a Comment