List users except current user using wp_dropdown_user? [closed]

Your problem is here:

'exclude' => '$user_id,1',

This will generate the string ‘$user_id,1’, it won’t insert the user ID into your string.

The reason for this is the difference between ‘$hello’ and “$hello” E.g.

$hello = 5;
echo '$hello'; // prints out $hello
echo "$hello"; // prints out 5

So using double rather than single quotes would fix your issue.

An even more reliable way

Use string concatenation to tie them together instead, e.g:

'exclude' => $user_id.',1',

The . operator joins two strings together, e.g.:

echo 'Hello there '.$firstname.', my name is '.$myname;

A more generic way

Use an array, and use implode to generate the string

$excluded_users = array();
$excluded_users[] = 1;
$excluded_users[] = $user_id;
// .. etc
'exclude' => implode( ',' , $excluded_users )

I recommend you read up on magic quotes in basic PHP and string handling