A draft for metadata storage to be used in plugins. (PR #2077)

As title says, this is a draft, and I would like some input on how I have structured it, and wheter it might be something that could be put in the core.

The initial idea, written here, kinda goes like this:

  • Implement tables similar to wp_usermeta in WordPress, but for users, posts and topics(for now)
  • Expose these on server-side in the correct models, and leave it open for plugin devs to use
  • Optionally allow read-only exposure to the frontend for metadata with client set to true.

The small changes would give plugin devs the possibility to do many basic things without filling the existing tables for users/posts/topics, and without the need to deploy their own tables.

Some notes

  • In the topic Model, I found that a key->value system named meta_data was already in place(using Postgres hstore). What is this used for and could it possibly be moved to this new system?
  • I did not write anything in the topic serializer, as I was not sure where to expose the metadata there. Where would it be most useful?


You’ve signed the CLA, ArmedGuy. Thank you! This pull request is ready for review.

Have you looked at the PluginStore?

Ah, actually, no. Would my code be useless seeing as there is an existing solution, or do you think it could be used to extend the storage capabilites for different models(for both plugins and the core itself)?