Closed reefdog closed 9 years ago
Sorry; the first bit of metadata is documents
, not documentcloud
.
So, realized that no matter how many embeds are on a post, only one documents
and wide_assets
gets created, keyed by the last embed. (Note how the update_post_meta()
calls are outside the foreach()
loop in save()
.) Which means we don't have to worry about colliding IDs, because only the last man standing is saved anyway.
Is this by design?
The idea with wide_assets
was that it only needs to be set once per post. It's a boolean, there's either something wide or there isn't, and having anything wide in the post means it needs to deal with that.
I'm trying to remember what the $documents
key was for. It's an array, so it makes sense that there's only one, but I can't remember why we were saving it. Maybe just because we could. (This was four years ago now.)
I'm inclined to remove documents
unless we can figure out its purpose. What do you think?
Grokked on wide_assets
.
I think it's fine to dump $documents
.
that seems ok to me too
Cool. I'll remove.
When a post is saved, we store a couple pieces of metadata:
documentcloud
documents
stores all the shortcode attributes. I don't know what it's used for.wide_assets
set totrue|false
to hint to the template that the post contains, well, wide assets. Several StateImpact sites respond to this hint according to https://github.com/documentcloud/wordpress-documentcloud/issues/16#issuecomment-94146235 and a Hangout conversation with @eyeseastWe have to make at least one change: both pieces of metadata are stored as hashes keyed by document slug. But now that we support notes – which are children of documents and thus whose URLs contain the document slug – we can have two embedded resources on the same post with the same hash key.
My recommendation:
documentcloud
documents
post meta is necessary (@eyeseast?) and if not, remove it