Change WordPress user roles and capabilities Forums Bug Reports message: Can not edit user or invalid data at the users list Reply To: message: Can not edit user or invalid data at the users list

#3960
Vladimir
Keymaster

User Role Editor does nothing if you see this error message. URE shows this message in 2 cases:
1) invalid user ID in the list of users ID to process;
2) current user can not edit one of the selected users. Look, may be you accidentally select some user with superadmin privileges.

Look how WordPress checks if user can edit other user under multisite:


// In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin.
if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) {
		$caps[] = 'do_not_allow';
	} else {
		$caps[] = 'edit_users'; // edit_user maps to edit_users.
	}

User should be a superadmin to edit other superadmin, or have ‘manage_network_users’ capability.