Last active
January 3, 2016 16:09
-
-
Save infn8/8487698 to your computer and use it in GitHub Desktop.
Add categories to your WordPress Images
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
<?php | |
// Begin Copy into functions.php | |
function image_category() { | |
$labels = array( | |
'name' => 'Image Categories', | |
'singular_name' => 'Image Category', | |
'menu_name' => 'Image Categories', | |
'all_items' => 'All Image Categories', | |
'parent_item' => 'Parent Image Category', | |
'parent_item_colon' => 'Parent Image Category:', | |
'new_item_name' => 'New Image Category Name', | |
'add_new_item' => 'Add New Image Category', | |
'edit_item' => 'Edit Image Category', | |
'update_item' => 'Update Image Category', | |
'separate_items_with_commas' => 'Separate Image Categories with commas', | |
'search_items' => 'Search Image Categories', | |
'add_or_remove_items' => 'Add or remove Image Categories', | |
'choose_from_most_used' => 'Choose from the most used Image Categories', | |
'not_found' => 'Image Category Not Found', | |
); | |
$args = array( | |
'labels' => $labels, | |
'hierarchical' => true, | |
'public' => true, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'show_in_nav_menus' => false, | |
'show_tagcloud' => false, | |
'rewrite' => false, | |
); | |
register_taxonomy( 'image_category', 'attachment', $args ); | |
} | |
// End Copy | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment