Using 1 taxonomy for multiple post types?

I previously declared the taxonomy ” artist ” for a profile post type.

Now i am creating a CD post type and would like to use the same artist list from the profile post type

That is one example if i get a solution i will be using this to share a number of other taxonomies among-st post types 😀

Thanks in Advance.

P.S. I use JW Custom Post Types
https://github.com/JeffreyWay/Easy-WordPress-Custom-Post-Types/

2 Answers
2

You can use an array of post types in register_taxonomy()

$object_type (array/string) (required) Name of the object type for the
taxonomy object. Object-types can be built-in Post Type or any Custom
Post Type that may be registered.

http://codex.wordpress.org/Function_Reference/register_taxonomy

Example:

register_taxonomy( 'artist', array( 'profile', 'cd' ), $args );

Leave a Comment