Custom columns for taxonomy list table

The manage_{TAXONOMY}_custom_column filter hook passes 3 arguments:

  • $content
  • $column_name
  • $term_id

So try this:

function add_book_place_column_content($content,$column_name,$term_id){
    $term= get_term($term_id, 'book_place');
    switch ($column_name) {
        case 'foo':
            //do your stuff here with $term or $term_id
            $content="test";
            break;
        default:
            break;
    }
    return $content;
}
add_filter('manage_book_place_custom_column', 'add_book_place_column_content',10,3);

Leave a Comment