Created
November 18, 2015 15:53
-
-
Save StephenPunwasi/c222497a6d75bc4bd0c2 to your computer and use it in GitHub Desktop.
Add Categories and Tags To Wordpress 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 To WordPress Attachments | |
add_action( 'init' , 'add_categories_for_attachments' ); | |
function add_categories_for_attachments(){ | |
register_taxonomy_for_object_type( 'category', 'attachment' ); | |
} | |
// Add Tags To WordPress Attachments | |
add_action( 'init' , 'add_tags_for_attachments' ); | |
function add_tags_for_attachments() { | |
register_taxonomy_for_object_type( 'post_tag', 'attachment' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment