I'm currently writing my first plugin, which will let the site admin/editor use a different image as a background/header for each post/page, and I would also like to have defaults for each category.
Here is where I'm not sure how to proceed: If for each post/page the image (which is an attachment, so is just an id in the db) is a simple post meta field, there is no such (implicit) thing for categories.
So there are more ways to go:
- Create an option for every category - something like
background_cat_$id_
- Add the categories which correspond to a certain image to the attachment post (
corresponding_cats
? ) - Modify the term_taxonomy table to add a column (last resort? bad design?)
Right now I believe I'll go with my first option but I'm really curios how you handle such issues.