5

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 :D

Thanks in Advance.

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

3
  • I asked the taxonomy and he said it was ok.
    – Wyck
    Feb 14, 2013 at 5:41
  • Please, check the faq and the page How to Ask.
    – brasofilo
    Feb 14, 2013 at 7:22
  • @Katmassive also mark the correct answer as accepted so it helps people find it easier :)
    – trainoasis
    Sep 10, 2019 at 7:08

2 Answers 2

15

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 );
1
1

You can easily use register_taxonomy_for_object_type() to link existing taxonomies to existing post types.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.