mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Update get_current_user_id() and move to user.php. Props filosofo. fixes #13785
git-svn-id: https://develop.svn.wordpress.org/trunk@15174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user