Make WordPress Core

Changeset 14090


Ignore:
Timestamp:
04/14/2010 10:06:03 PM (14 years ago)
Author:
nacin
Message:

Deprecate set_current_user() in favor of wp_set_current_user().

Location:
trunk
Files:
4 edited

Legend:

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

    r13255 r14090  
    1515 * Deprecated functions come here to die.
    1616 */
     17
     18if ( !function_exists('set_current_user') ) :
     19/**
     20 * Changes the current user by ID or name.
     21 *
     22 * Set $id to null and specify a name if you do not know a user's ID.
     23 *
     24 * @since 2.0.1
     25 * @see wp_set_current_user() An alias of wp_set_current_user()
     26 * @deprecated 3.0.0
     27 * @deprecated Use wp_set_current_user()
     28 *
     29 * @param int|null $id User ID.
     30 * @param string $name Optional. The user's username
     31 * @return object returns wp_set_current_user()
     32 */
     33function set_current_user($id, $name = '') {
     34    _deprecated_function( __FUNCTION__, '3.0', 'wp_set_current_user()' );
     35    return wp_set_current_user($id, $name);
     36}
     37endif;
    1738
    1839if ( !function_exists('wp_setcookie') ) :
  • trunk/wp-includes/pluggable.php

    r14070 r14090  
    66 * @package WordPress
    77 */
    8 
    9 if ( !function_exists('set_current_user') ) :
    10 /**
    11  * Changes the current user by ID or name.
    12  *
    13  * Set $id to null and specify a name if you do not know a user's ID.
    14  *
    15  * @since 2.0.1
    16  * @see wp_set_current_user() An alias of wp_set_current_user()
    17  *
    18  * @param int|null $id User ID.
    19  * @param string $name Optional. The user's username
    20  * @return object returns wp_set_current_user()
    21  */
    22 function set_current_user($id, $name = '') {
    23     return wp_set_current_user($id, $name);
    24 }
    25 endif;
    268
    279if ( !function_exists('wp_set_current_user') ) :
  • trunk/wp-includes/user.php

    r13827 r14090  
    479479 * Set up global user vars.
    480480 *
    481  * Used by set_current_user() for back compat. Might be deprecated in the
    482  * future.
     481 * Used by wp_set_current_user() for back compat. Might be deprecated in the future.
    483482 *
    484483 * @since 2.0.4
  • trunk/xmlrpc.php

    r13725 r14090  
    280280        }
    281281
    282         set_current_user( $user->ID );
     282        wp_set_current_user( $user->ID );
    283283        return $user;
    284284    }
Note: See TracChangeset for help on using the changeset viewer.