Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Role meta #110

Open
justintadlock opened this issue Aug 29, 2016 · 1 comment
Open

Role meta #110

justintadlock opened this issue Aug 29, 2016 · 1 comment

Comments

@justintadlock
Copy link
Owner

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:

members_role_meta = array(

    $role_slug = array(
        key => value,
        key => value
    ),
    $role_slug2 = array(
        key => value,
        key => value
    )
);

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.

@renatonascalves
Copy link

Second option seems better to me. I also agree with you a custom table might be too much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants