Can you return users of a higher role than the current user using get_users()?

You wrote you need to generate a dropdown list with users. As I thought right – not tied to roles.

wp_dropdown_users() maybe helpful. It will generate a dropdown list for you. Just checked on my wp install, it’s still returning me a list of all users, doesn’t matter if I logged in as administrator or subscriber.

wp_dropdown_users() has a lot of attributes, which may be useful in your case – include, exclude users, show users by roles, show default value if no user was selected and so on.

Pay attention, that this function echoes html select list by default, attribute ‘echo’ should be set to false if you want to get html code in a variable.

wp_dropdown_users code reference

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)