Skip to content

Instantly share code, notes, and snippets.

@abrudtkuhl
Created August 8, 2014 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abrudtkuhl/54437529367925aa2bca to your computer and use it in GitHub Desktop.
Save abrudtkuhl/54437529367925aa2bca to your computer and use it in GitHub Desktop.
Add Already Registered Custom Taxonomy To Custom Post Type
add_action('init','add_categories_to_cpt', 200);
function add_categories_to_cpt(){
register_taxonomy_for_object_type('search_tags', 'post_type');
}
@abrudtkuhl
Copy link
Author

If you have already defined your custom taxonomy in another plugin and want to use it in a custom post type that you might register in a second plugin, you'll need to add this in your custom post type definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment