So, I’m not sure if this is possible, but is it possible to add custom Capabilities?
So, I’ve written a group message application, that ties in with WordPress. I only want certain members (set via options that I just asked about) to be able to send out such messages. I’d like to add a capability for, say “group_message”, and add it to specific users (since it isn’t strictly editors / administrators who have access to send out).
I know about:
wp_current_user()->add_cap()
But is the only thing I need to do, say: wp_current_user()->add_cap(‘group_message’)?
I just happened to provide a short example of setting up a custom role capability (exaplanation and code). In your case, however, you want to add the capability to particular users – not roles.
The following code may be a starting point for what you want to do:
>>> Setting it up
>>> Using it
>>> Cleaning it up
All you need to do now, is think about getting/providing the user IDs. You could, for instance, list all users on your plugin menu page (if you have one), then select the ones you’d like to be capable of group messaging, and finally add the capability to those users.