We need a way to store role meta so that add-ons can easily have a way to store additional data for a role.
I don't really like the idea of creating an entire wp_rolemeta table even though it'd make it really easy to extend with *_meta() functions. It seems like that'd be overkill. Plus, roles don't have a table of their own nor associated IDs. So, that idea is probably off the table anyway.
A simple option under wp_options would probably suffice. I'm thinking storing a set of metadata for each role as a single option would work like so:
members_role_meta_{$role_slug} = array(
key => value,
key => value
);
The other option would be a single DB option like so:
We need a way to store role meta so that add-ons can easily have a way to store additional data for a role.
I don't really like the idea of creating an entire
wp_rolemeta
table even though it'd make it really easy to extend with*_meta()
functions. It seems like that'd be overkill. Plus, roles don't have a table of their own nor associated IDs. So, that idea is probably off the table anyway.A simple option under
wp_options
would probably suffice. I'm thinking storing a set of metadata for each role as a single option would work like so:The other option would be a single DB option like so:
I lean toward the former in the off-chance that someone has a lot of role meta that they want to store. Just seems like it'd scale a lot more nicely.