[wp-hackers] Time for a wp_post_relationships table?
mpretty at voceconnect.com
Wed Aug 4 01:43:14 UTC 2010
Here is my take on the post relationships table.
The first project I had to create a many to many relationship between
objects on was for a radio station back in WP 2.8. The radio station
had posts and shows as post types. For the most part, a post would only
be related one show, but there were times where a post could be linked
to multiple, so that they needed to show up in that show's loop. We
solved this by the way that was suggested, creating a custom taxonomy
for shows and pairing a term for each show post created. On our staging
server, it worked flawlessly. Then we started letting the client use it
on the live site. Once the client started using the site, we started
running into issues.
-You can have more than one post with the same title, but you can only
have 1 term of a single title...clients will create multiple of the same
object, don't ask why.
-If you renamed a post, you may not always successfully be able to
rename the term if there is a conflict.
-Because of the way term names span multitple taxonomies, you may not
always be able to have the name be exactly as the client wants due to
Because of these stability issues, I believe that a many to many posts
table is the best solution. That said, I don't think it should be
something added to core, at least not yet. I don't think this is a
feature most users are knocking on the door to get and I'd rather see it
get implemented in a few plugins that go through hundreds of different
use cases before pulling the best solution into core.
More information about the wp-hackers