Have a custom meta field for your wordpress categories or custom taxonomies? Want your custom field to be displayed on a custom admin column on the category admin page?
Once you have created your custom field for wp categories and taxonomies, you can display it by posting this snippet in your functions.php file as follows:
First, lets start by adding the column and column heading to categories admin table.
1 2 3 4 5 6 7 |
function manage_my_category_columns($columns) { // add 'My Custom Column' $columns['my_custom_column'] = 'My Custom Column'; return $columns; } add_filter('manage_edit-category_columns','manage_my_category_columns'); |
Lastly, lets display the date for each category term in the custom WP admin column we just created.
1 2 3 4 5 6 |
function manage_category_custom_fields($deprecated,$column_name,$term_id) { if ($column_name == 'my_custom_column') { echo 'test'; } } add_filter ('manage_category_my_custom_column', 'manage_category_custom_fields', 10,3); |