Add Already Registered Custom Taxonomy To Custom Post Type

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 something like this in your custom post type definition.

The ‘register_taxonomy_for_object_type($taxonomy, $object_type)‘ function is quite nifty. I’ve also used it to enable the standard Category taxonomy on Pages.

Published by

Andy Brudtkuhl

Andy is a full stack web developer, growth hacker, entrepreneur, bike commuter, seinfeld enthusiast, and daddy to three little girls and two dogs in Iowa.

Leave a Reply

Your email address will not be published. Required fields are marked *