Context
Maybe because WordPress does not like to consider its users (pun intended) it also neglects its functions that deal with “users”.
So for example the wp_dropdown_users( $args = '' )
function produces a select with all users, but it does not let you change the value of those select options
I am not sure why this feature was omitted, but as said, maybe it has to do with WP and Users not being on a nice path anyway
I amended that function in my plugins already quite some time ago as I need a customisable value attribute in the select option.
The change simply adds one new argument:
@type string $value_field User `data` object values to use as selection option **value**. Accepts any User `data` object property. Default to user ID.
BTW, this is already done in core’s wp_dropdown_categories
, so there is no reason not to do it in wp_dropdown_users()
as well.
Will you be able to help with the implementation?
Already done, just need to PR it.
If you do not want to waste votes also a comment will do for me.