[wp-hackers] Link metadata?

Mike Schinkel mikeschinkel at newclarity.net
Wed Jun 17 01:40:08 GMT 2009


"Dougal Campbell" <dougal at gunters.org> wrote:
> It would also aid in the future migration towards more generic 
> CMS capabilities in core WP, since it would be extensible for 
> future data types.

So is this something the community is ready to start moving toward, with 2.9?  Should we minimally add a wp_meta table to allow support for link, comments, and other meta even if we don't immediately migrate away from wp_postmeta and wp_usermeta?

> I was going to suggest either adding metadata to the main post, 
> with info about the child links (could connect by linkid), 

I *think* that's what I described as an option, i.e. in wp_postmeta a 'post_links' field that would store the comma-separated link_ids in a single string meta value. If that's not what you where thinking can you explain (in code?)

> or even by using a child-post (more technically, an attachment) to 
> house the extra data. 

Are you suggesting a post_type='attachment' or instead adding something like post_type='link'?
 
> This isn't as elegant as attaching the metadata directly to the 
> links in some way, 

Even with link metadata I still somehow need (to simulate) a linking table to associate the links with a post, hence the 'post_links' value in wp_postmeta.

> Done right, you could even reference the same link (by its 
link ID) from different posts, but using different link 
> metadata in each instance. I could probably think of some 
> interesting use-cases for that.

Now that's another level I didn't need for my use-case but it does make it more interesting. We could use the wp_postmeta values for the 'attachment/link' in wp_posts to give each link different metadata than the metadata for the link that would be shared by all.  It actually works well form a database perspective. Of course the "hitch" is building a good UI so an admin user can access all that power. :)


-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins


More information about the wp-hackers mailing list