| 179 | $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND ID != %d LIMIT 1" , $user_nicename, (int) $ID)); |
| 180 | |
| 181 | if ($user_nicename_check) { |
| 182 | $suffix = 2; |
| 183 | while ($user_nicename_check) { |
| 184 | $alt_user_nicename = $user_nicename . "-$suffix"; |
| 185 | $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND ID != %d LIMIT 1" , $alt_user_nicename, (int) $ID)); |
| 186 | $suffix++; |
| 187 | } |
| 188 | $user_nicename = $alt_user_nicename; |
| 189 | } |
| 190 | |