Use API to retrieve user. fixes #11776
git-svn-id: http://svn.automattic.com/wordpress/trunk@12935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
559888b3ac
commit
a62e167391
|
@ -112,9 +112,9 @@ switch ( $_GET['action'] ) {
|
|||
if ( $mainblog_id ) {
|
||||
reset( $site_admins );
|
||||
foreach ( (array) $site_admins as $site_admin ) {
|
||||
$uid = $wpdb->get_var( "SELECT ID FROM {$wpdb->users} WHERE user_login='{$site_admin}'" );
|
||||
$uid = get_user_by('login', $site_admin);
|
||||
if ( $uid )
|
||||
add_user_to_blog( $mainblog_id, $uid, 'administrator' );
|
||||
add_user_to_blog( $mainblog_id, $uid->ID, 'administrator' );
|
||||
}
|
||||
}
|
||||
update_site_option( 'site_admins' , $site_admins );
|
||||
|
|
Loading…
Reference in New Issue