[wp-hackers] Time for a wp_post_relationships table?

Otto otto at ottodestruct.com
Tue Aug 3 19:03:39 UTC 2010

On Tue, Aug 3, 2010 at 1:41 PM, Lox <lox.dev at knc.nc> wrote:
> Otto, mirroring custom posts to taxonomies can be a bad ass, I mean,
> creating needs to be handled, as well as modification and deletion. So
> the question is: can't wordpress provides helpers for custom post
> mirroring to a taxonomy? Like adding a "mirror_taxonomy_id" parameter
> to custom post_type....

But what exactly are you mirroring? The title of the post? Some of the
content? A custom field? Posts are not taxonomies, which is why this
has to be left up to the specific implementation. How you define your
terms based on your post content is really your choice, sort of thing.

It's not really all that hard to do, you simply add the term to the
post with wp_set_object_terms when the post is published, and perhaps
modify it when the post is edited (delete will be handled
automatically, as when a post goes away, so does it's relationship
with its terms). You can probably use transistion_post_status to
handle both of those.


More information about the wp-hackers mailing list