Created
November 2, 2015 08:55
-
-
Save dannyconnolly/e26f3d062849d48108c1 to your computer and use it in GitHub Desktop.
Add taxonomies to worpress media attachments
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
/** | |
* add categories for attachments | |
*/ | |
function add_categories_for_attachments() { | |
register_taxonomy_for_object_type('category', 'attachment'); | |
} | |
add_action('init', 'add_categories_for_attachments'); | |
/** | |
* add tags for attachments | |
*/ | |
function add_tags_for_attachments() { | |
register_taxonomy_for_object_type('post_tag', 'attachment'); | |
} | |
add_action('init', 'add_tags_for_attachments'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment