Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Prepend the new column to the columns array
- function cb_customtag_columns($cols) {
- $cols['racetype'] = 'Race Types';
- $cols['racedistance'] = 'Race Distance';
- $cols['racelocation'] = 'Race Location';
- $cols['awards'] = 'Race Awards';
- return $cols;
- }
- // Echo the ID for the new column
- function cb_customtags_value($column_name, $id) {
- if ($column_name == 'racetype'){
- echo get_the_term_list( $id, 'racetype', '', ', ', '' );
- }
- if ($column_name == 'racedistance'){
- echo get_the_term_list( $id, 'racedistance', '', ', ', '' );
- }
- if ($column_name == 'racelocation'){
- echo get_the_term_list( $id, 'racelocation', '', ', ', '' );
- }
- if ($column_name == 'awards'){
- echo get_the_term_list( $id, 'awards', '', ', ', '' );
- }
- }
- function cb_add_custom_taxonomy_col()
- {
- add_filter('manage_race_posts_columns', 'cb_customtag_columns');
- add_action('manage_race_posts_custom_column', 'cb_customtags_value', 10, 2);
- }
- add_action('admin_init', 'cb_add_custom_taxonomy_col');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement