|Reported by:||filosofo||Owned by:|
There is not a direct, reliable way to access the current user's ID. You either have to get the user object and then the ID property if present, or assume that the $current_user global is populated already (and that's not a reliable assumption).
get_current_user_id is the perfect solution and existed (imperfectly) in MU. Rather than deprecating it, we should move it to general WP and make it use the WP pluggable user functions.