I’ve been searching for this for ages, but could not come with a solution. Drupal 7 provided a way to get the user ID of a newly created user after running user_save()
; the new user has been added and the user ID has been returned in the object.
In Drupal 8, when I use User::create()
, it only returns a constant based on whether the user has been created or updated. Is there any way to get the user ID after the user has been created?