The documentation for the user_delete function in /includes/functions_users.php is incorrect. It is:
/**
- Delete user(s) and their related data
* - @param string $mode Mode of posts deletion (retain|delete)
- @param mixed $user_ids Either an array of integers or an integer
- @param bool $retain_username True if username should be retained, false otherwise
- @return bool
*/
$mode should be:
- @param string $mode Mode of posts deletion (retain|remove)
It addition, this function could probably be improved by returning an error if the $mode parameter is passed some value other than retain or remove. I passed delete and it did not delete the posts too, leading to an inconsistent database. In addition, the last line of the function returns false. I don't see any condition where the function returns true, so perhaps this needs to be changed as well.