How to get the ID of the currently logged in user?

get_current_user_id() effectively does what @Giri had described in the first snippet. The internal WordPress function-call chain eventually calls get_currentuserinfo() which already checks if there is a WP_User object, meaning a user is logged in.

Thus, from what I can see in the linked code, get_current_user_id() always returns the ID of the user that is logged in or zero 0.

In the current default theme twentytwelve they are using get_the_author_meta() to retrieve information about the user, for whom the current author page is displayed. So the difference in WP terminology seems to be “user” for th current, logged in user and “author” for some user, identified by an ID. See: twentytwelve/author.php.

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş