I have two users with the capability to create other users. But their roles are not same.
- Tom - Role is Administrator
- Jackie - Role is CMS Manger (a custom created role)
Both have capability to create new users.
CMS Manger
gets this capability by following code:
add_action( 'after_setup_theme', 'add_caps_to_custom_roles' );
function add_caps_to_custom_roles() {
$caps = array(
'list_users',
'edit_users',
'create_users',
'delete_users',
);
$roles = array(
get_role( 'CMS Manager' ),
);
foreach ($roles as $role) {
foreach ($caps as $cap) {
$role->add_cap( $cap );
}
}
}
I have 120 users in the site now. But do not know who created whom. I want a list that shows :
- List of users created by
tom
- Tom's users - List of users created by
jackie
- Jackie's users
I was referring this for a while : https://codex.wordpress.org/Function_Reference/get_user_by
But seems that function has NO
solution for the above type of list.
How can I create those lists?
user_contactmethods
. Is there any way to add a custom field during aNEW
user registration? Now I am looking for a solution by using the hookuser_new_form
whicj introduced in WP 3.7