I want to give a group of user types (Editor + a custom role) the add_users /create_users capability. The only catch is that I wanted to limit that capability to adding 'subscriber' type users only, and nothing above that. Is there a way to do this?
This first step to making this happen is add the capability to
If you do that, you probably want to make sure to undo it on plugin deactivation with
Now the problem of making sure those users can only register subscribers. On the
Fortunately for you, there's a filter in there that will allow us to modify this bit. First we'll copy all the
The bonus part of this is that
All that as a plugin.
The answer of @chrisguitarguy is good. I've made a small modification to the code to have it work from a development bureau serving customers on a multi-site install. We were in need to create a 'customer' user role, but of course a customer should not be allowed to add another customer to its domain. Modified from the accepted answer I've come to this:
Hoping someone might find some use for this in the future. This was tested and applied in WP3.9.1.