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.

Here's my situation....

I'm creating a plugin that will allow families to register on the site I'm working on. Each family will have 1 or more children that they need to add to their registration. My initial thought was to make 2 custom post types - Family and Child and relate them either through metadata or through a custom table (1 to many joins).

My question is, is it possible in wordpress to create an admin page that would allow adding and/or editing of a family and all of the related children in one place (including adding, removing, and editing children as necessary)? If so, are there resources out there that can show me how to do it?

Thanks, Jon

share|improve this question
add comment

3 Answers

It is not possible by default with WordPress (i.e. no internal mechanism for such relations) however the Types free plugin could do 1:M post relationship work within the standard SQL tables - http://wp-types.com/home/types-manage-post-types-taxonomy-and-custom-fields/ - and there is an extra powerful plugin in addition to that used for listing if you need it (or you could code it if you like).

share|improve this answer
add comment

There're multiple things you can do. The first and most obvious would be to create a n:n relation using the "posts2posts-plugin.

Another one would be to make your CPT hierarchical, so you can choose the parent/children relationship there.

I wouldn't use custom taxonomies as family names can be shared under not related families and if you'd have another one for relationsship-status, you'd have the problem that someone can be father, brother, grandfather, etc. at the same time, so you'd be adding a very non important meta information there.

share|improve this answer
add comment

You could also use custom fields, if you want to keep everything family-related on one admin page. The plugin Advanced Custom Fields makes this super-easy. You might want to buy the "repeater field" add-on which would enable you to on-the-fly add any number of child field groups.

share|improve this answer
add comment

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.