WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code to add a new column to my taxonomy edit screen (edit-tags.php?taxonomy=book_place&post_type=books)

function add_book_place_columns($columns){
    $columns['foo'] = 'Foo';
    return $columns;
add_filter('manage_edit-book_place_columns', 'add_book_place_columns');

function add_book_place_column_content($content){
    content = 'test';
    return $content;
add_filter('manage_book_place_custom_column', 'add_book_place_column_content');

Its working, but i need to access the current term id in the "add_book_place_column_content" function. How can i do that?

share|improve this question
up vote 5 down vote accepted

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';
    return $content;
add_filter('manage_book_place_custom_column', 'add_book_place_column_content',10,3);
share|improve this answer
Thanks, its working, but you forgot the $ before content = 'test' :) – passatgt Dec 30 '12 at 13:32
thanks updated! – Bainternet Dec 30 '12 at 18:58
Thanks, it worked! – Imran Ali Apr 8 at 7:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.