Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a CPT called adverts and it has 2 taxonomies - category and location. The problem is that there are about 100 entries in location taxonomy and I need to copy the same structure to another CPT - businesses. Doing everything manually will take forever. Are there any solutions for that?

P.S. Taxonomy structure includes parent and children hierarchy P.P.S. I checked the DB structure and due to its design it is hard to find all relations and taxonomies there as they are in various tables. Maybe there some kind of a plugin?

share|improve this question
    
Do you want to copy 100 location terms from your original post/page type to the CPT type? –  AlxVallejo Jul 21 '12 at 16:32
    
Nope, I have a CPT "adverts" that has taxonomy "location" consisting of 100 terms. And I need my CPT "businesses" to have the same taxonomy with the same terms –  Vladimir Hraban Jul 21 '12 at 16:44
    
How are you registering the taxonomies? –  AlxVallejo Jul 21 '12 at 16:59

1 Answer 1

up vote 1 down vote accepted

When you register the taxonomies you can specify multiple post types:

function register_my_taxonomies() {
register_taxonomy(
                  'location',
                  array('post','page', 'adverts', 'businesses'),
share|improve this answer
    
Heh, that was so easy. I had no idea that the post type can be in array when registering the taxonomy. Life saver! –  Vladimir Hraban Jul 21 '12 at 17:08
    
My pleasure. Welcome to the site! –  AlxVallejo Jul 21 '12 at 18:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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