[wp-hackers] Time for a wp_post_relationships table?

Casey Bisson casey.bisson at gmail.com
Tue Aug 3 14:06:18 UTC 2010


Mike,

I'm actually a bit sympathetic to your question, but many of the
relationships you describe are taxonomy-style relationships. I think what
you're really looking for is how to durably attach a post (of any type) to a
specific term/taxonomy pair. Perhaps an extra field for post_id in the
term_taxonomy table is what you need?

Some WP themes and sites have used the category/taxonomy description field
very well. I see Michael Pretty's scenario to be an extension of that (more
sophisticated, but not an entirely different animal). I can imagine that we
could enable many uses of WP by moving that description field into a new
post type and replacing the that field in the table with a post_id number
that links them.

--Casey

On Tue, Aug 3, 2010 at 4:05 AM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

The use-cases for post-to-post are probably not very apparent when using
> WordPress only as a blog but become much more apparent when one starts using
> it as a CMS with lots of different data types.  I'll give you numerous
> examples where I've needed it in the past several months (#1 thru #3 are
> actual projects I've worked on, #4 & #5 are hypothetical):
>
> 1.) A law firm website has attorneys, practice areas, articles, case
> studies, and events/presentations.  Each attorney is in one or more practice
> areas.  Each article and each case study can be attached to one or more
> attorneys and relevant to one or more practice areas.  Each
> event/presentation can have one or more attorneys presenting and can be
> represented one one or more practice areas' calendars.
>
> 2.) A conference website can have sessions, sponsors, presenters, time
> slots and rooms. A session can have one or more presenters and be presented
> in one or more time slots and one room per time slot ,and a presenter can
> represent a sponsor or not.
>
> 3.) A website listing restaurant menus can have restaurants, locations,
> menus. A restaurant can have one or more locations and one or more menus
> (breakfast, lunch, dinner, catering, etc.) A menu can apply to all locations
> for a restaurant or only a specific location.
>
> 4.) A movie website could have movies and person-roles where a person-role
> could be an actor, producer, cinematographer, casting, film editing,
> costumer, set designer, composer, etc.
>
> 5.) A hospital website has doctors and departments.  Each department can
> have multiple doctors and each doctor can work in multiple departments.
>
> 6.) A radio station website could have stations and disc jockey's where a
> station could have multiple disc jockeys and each disc jockey could appear
> on multiple stations (given how radio works these days.)
>
> I could actually give you many other examples if you need it; there is an
> example for almost every business that could potentially use WordPress for
> it's website (vs. just it's blog.)


More information about the wp-hackers mailing list