From d68747d9af085094e04bced76867602d5b36d934 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 8 Jun 2010 15:12:15 +0000 Subject: [PATCH] Update get_current_user_id() and move to user.php. Props filosofo. fixes #13785 git-svn-id: http://svn.automattic.com/wordpress/trunk@15174 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-deprecated.php | 10 ---------- wp-includes/user.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index 8436426b1..b60736283 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -95,16 +95,6 @@ text-align: center; } endif; -/** - * @since MU - * @deprecated 3.0.0 - * @deprecated Use $GLOBALS['current_user']->ID - */ -function get_current_user_id() { - _deprecated_function( __FUNCTION__, '3.0', '$GLOBALS[\'current_user\']->ID' ); - return $GLOBALS['current_user']->ID; -} - /** * @since MU * @deprecated 3.0.0 diff --git a/wp-includes/user.php b/wp-includes/user.php index 932b4d6f5..733f0b840 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -210,6 +210,20 @@ function user_pass_ok($user_login, $user_pass) { // User option functions // +/** + * Get the current user's ID + * + * @since MU + * + * @uses wp_get_current_user + * + * @return int The current user's ID + */ +function get_current_user_id() { + $user = wp_get_current_user(); + return ( isset( $user->ID ) ? (int) $user->ID : 0 ); +} + /** * Retrieve user option that can be either per Site or per Network. *