This page redirects to an external site: https://developer.wordpress.org/reference/functions/get_current_user_id/
Languages: English • Italiano • (Add your language)
Returns the ID of the current user.
Use the init or any subsequent action to call this function. Calling it outside of an action can lead to troubles.
<?php $user_ID = get_current_user_id(); ?>
Since: Version 3.0
get_current_user_id() is located in wp-includes/user.php.
Get User Functions:
Current User Functions: get_current_user_id(), get_currentuserinfo(), wp_get_current_user(), wp_set_current_user(), current_user_can(), current_user_can_for_blog()