Last active
May 6, 2021 19:26
-
-
Save jacobwise/c4cb6192e15268a7a2e1 to your computer and use it in GitHub Desktop.
How to remove the category description column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Remove default description column from category | |
| * | |
| */ | |
| function jw_remove_taxonomy_description($columns) | |
| { | |
| // only edit the columns on the current taxonomy, replace category with your custom taxonomy (don't forget to change in the filter as well) | |
| if ( !isset($_GET['taxonomy']) || $_GET['taxonomy'] != 'category' ) | |
| return $columns; | |
| // unset the description columns | |
| if ( $posts = $columns['description'] ){ unset($columns['description']); } | |
| return $columns; | |
| } | |
| add_filter('manage_edit-category_columns','jw_remove_taxonomy_description'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you just want to truncate the description, in those cases when it's long but you still want to see it in the admin table, use this: