Instantly share code, notes, and snippets.

Embed
What would you like to do?
add custom column to taxonomy (carousel_category) list table page.
<?php
/*
* filter pattern: manage_edit-{taxonomy}_columns
* where {taxonomy} is the name of taxonomy e.g; 'carousel_category'
* codex ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_$taxonomy_id_columns
*/
add_filter( 'manage_edit-carousel_category_columns' , 'wptc_carousel_category_columns' );
function wptc_carousel_category_columns( $columns ) {
// remove slug column
unset($columns['slug']);
// add carousel shortcode column
$columns['carousel_shortcode'] = __('Carousel Shortcode');
return $columns;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment