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'm building a program registration system that will have a complex data structure. There are programs (custom post type, CPT), teachers (CPT), registrations (custom table and meta table), payments (custom table and meta table), and later accommodations (CPT) and lastly Users (wp users table).

I want to be able to use nice wordpress taxonomy features with my custom registration and payment tables. But I'm assuming I can't because the taxonomy system is only for the posts table. Is this correct? Basically I want to easily assign categories to registrations, and later be able to search on that, and have it flexible so the user can create their own categories.

I ruled out using custom post type for the registrations and the payment tables only because then I would need a separate plugin to link everything up (scribu's post to post plugin) and it would make any mysql queries incredibly complicated.

any advice would be greatly appreciated.

share|improve this question
    
did you manage to link up custom tables to a custom taxonomy? I am trying to do the same thing and am having trouble –  EJEHardenberg Apr 29 at 15:37

1 Answer 1

up vote 2 down vote accepted

You can assign taxonomies to objects saved in tables other than the posts table. WordPress explicitly supports that (e.g. there is the function _update_generic_term_count to update the term count for those types of taxonomies) and even use it for links.

I have used it once.

Just register your taxonomies as you would for regular post types ( register_taxonomy( 'your_taxonomy', 'registration', $args ); ).

register_taxonomy_for_object_type( 'your_taxonomy', 'registration' ) won't work though. I need to fill a bug report for that... (well, that's what I said to myself last time and I forgot... :) )

share|improve this answer
    
so it has the potential to work, but it doesn't work? And would you get the nice taxonomy editing screen and the nice taxonomy sidebar adding thingy? I guess all queries would need to be custom, because query_posts is obviously only for posts. –  dwenaus Nov 22 '11 at 18:40
2  
Yes, you will everything that comes with the 'normal' taxonomies. You will need to add the taxonomy edit screen to the admin menu yourself though (you can access the screen at /wp-admin/edit-tags.php?taxonomy=your_taxonomy but it won't be automatically added to the admin menu). Most queries don't need to be custom as you can use the generic WordPress functions get_objects_in_term, is_object_in_term, wp_get_object_terms, wp_set_object_terms, etc. –  sorich87 Nov 22 '11 at 18:53
    
great thanks, very helpful! –  dwenaus Nov 22 '11 at 19:59

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.