WordPress.org

Make WordPress Core

Changeset 12935


Ignore:
Timestamp:
02/03/10 17:37:15 (4 years ago)
Author:
ryan
Message:

Use API to retrieve user. fixes #11776

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-edit.php

    r12878 r12935  
    113113                reset( $site_admins ); 
    114114                foreach ( (array) $site_admins as $site_admin ) { 
    115                     $uid = $wpdb->get_var( "SELECT ID FROM {$wpdb->users} WHERE user_login='{$site_admin}'" ); 
     115                    $uid = get_user_by('login', $site_admin); 
    116116                    if ( $uid ) 
    117                         add_user_to_blog( $mainblog_id, $uid, 'administrator' ); 
     117                        add_user_to_blog( $mainblog_id, $uid->ID, 'administrator' ); 
    118118                } 
    119119            } 
Note: See TracChangeset for help on using the changeset viewer.