Revert f71858b85e (SVN 862207)

* Don't unncessesarily cast or define the user_id
* Bring back the get_userdata() check, so we avoid undefined variable warnings (https://wordpress.org/support/topic/undefined-property-error-1)