Skip to content

Instantly share code, notes, and snippets.

@talentedaamer
Last active September 3, 2018 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talentedaamer/1646503a5680a546a6e0db9d60523201 to your computer and use it in GitHub Desktop.
Save talentedaamer/1646503a5680a546a6e0db9d60523201 to your computer and use it in GitHub Desktop.
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