Make WordPress Core

Changeset 15174


Ignore:
Timestamp:
06/08/2010 03:12:15 PM (13 years ago)
Author:
ryan
Message:

Update get_current_user_id() and move to user.php. Props filosofo. fixes #13785

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-deprecated.php

    r15170 r15174  
    9999 * @since MU
    100100 * @deprecated 3.0.0
    101  * @deprecated Use $GLOBALS['current_user']->ID
    102  */
    103 function get_current_user_id() {
    104     _deprecated_function( __FUNCTION__, '3.0', '$GLOBALS[\'current_user\']->ID' );
    105     return $GLOBALS['current_user']->ID;
    106 }
    107 
    108 /**
    109  * @since MU
    110  * @deprecated 3.0.0
    111101 * @deprecated Use get_user_by()
    112102 * @see get_user_by()
  • trunk/wp-includes/user.php

    r14931 r15174  
    210210// User option functions
    211211//
     212
     213/**
     214 * Get the current user's ID
     215 *
     216 * @since MU
     217 *
     218 * @uses wp_get_current_user
     219 *
     220 * @return int The current user's ID
     221 */
     222function get_current_user_id() {
     223    $user = wp_get_current_user();
     224    return ( isset( $user->ID ) ? (int) $user->ID : 0 );
     225}
    212226
    213227/**
Note: See TracChangeset for help on using the changeset viewer.