Changeset 14226
- Timestamp:
- 04/24/2010 06:39:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r14222 r14226 253 253 $user = new WP_User($user_id); 254 254 255 if ( empty($user) )255 if ( empty($user) || !$user->ID ) 256 256 return new WP_Error('user_does_not_exist', __('That user does not exist.')); 257 257 … … 1318 1318 1319 1319 $details = get_option( 'new_user_' . $key ); 1320 add_existing_user_to_blog( $details ); 1321 delete_option( 'new_user_' . $key ); 1322 wp_die( sprintf(__('You have been added to this blog. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ) ); 1320 if ( !empty( $details ) ) 1321 delete_option( 'new_user_' . $key ); 1322 1323 if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) 1324 wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), site_url() ) ); 1325 1326 wp_die( sprintf(__('You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ), __('Success') ); 1323 1327 } 1324 1328 1325 1329 function add_existing_user_to_blog( $details = false ) { 1326 1330 if ( is_array( $details ) ) { 1327 add_user_to_blog( '', $details[ 'user_id' ], $details[ 'role' ] ); 1328 do_action( 'added_existing_user', $details[ 'user_id' ] ); 1329 } 1331 $result = add_user_to_blog( '', $details[ 'user_id' ], $details[ 'role' ] ); 1332 do_action( 'added_existing_user', $details[ 'user_id' ], $result ); 1333 } 1334 return $result; 1330 1335 } 1331 1336
Note: See TracChangeset
for help on using the changeset viewer.