Created
May 11, 2012 10:31
-
-
Save mattboon/2658869 to your computer and use it in GitHub Desktop.
WordPress - Add Tag ID column for post_tags
This file contains 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 columns from Tags section and add Tag ID | |
// ------------------------------------------------------------- | |
add_filter('manage_edit-post_tag_columns', 'my_post_tag_columns', 5); | |
function my_post_tag_columns($defaults) { | |
$defaults['tag_id'] = 'Tag ID'; | |
unset($defaults['description']); | |
unset($defaults['slug']); | |
return $defaults; | |
} | |
add_action('manage_post_tag_custom_column', 'post_tag_fill_columns', 5, 3); | |
function post_tag_fill_columns($value, $column_name, $id) { | |
if( $column_name == 'tag_id' ) { | |
return (int)$id; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment