Admin edit.php custom column for Taxonomy
-
Hi.
I want to add a column to the admin edit.php page for a custom taxonomy I have.
The column header is appearing. The code works when applied to a custom post type rather than a custom taxonomy.
The idea is, i have a sports league, each team is a taxonomy term. I’m using Advanced Custom Fields to link each term another taxonomy & term which is Leagues. In my custom column I want to display the league
Here’s the code
function my_page_columns($columns) { $columns = array( 'cb' => '<input type="checkbox" />', 'name' => __('Name'), 'league' => 'League', 'slug' => __('Slug'), 'posts' => __('Posts') ); return $columns; } function my_custom_columns($column) { if($column == 'league') { echo 'hi'; //using 'hi' as an example to try and get something to display for now } } add_action("manage_oposition_teams_custom_column", "my_custom_columns"); add_filter("manage_edit-oposition_teams_columns", "my_page_columns");
Any help would be greatly appreciated.
- The topic ‘Admin edit.php custom column for Taxonomy’ is closed to new replies.