I created a custom field using advance custom field plugin, and I selected in field type “user”, which actually is a dropdown containing all of the users. I then added this field to a custom post.
All users have a unique 4 digit number in their profiles.
My client wants that, instead of having the users displayed in this dropdown when creating a new post, he wants to have the name AND this 4 digit number that each user has in its profile.
Is there a way to modify the “user” field type to have it show additional information?
It’s not possible to filter the results on the dropdown. There are 3 filters available but only to modify the arguments to
get_users()
.What is possible is to create your own field type. Use the file
advanced-custom-fields/core/fields/user.php
as template to create your custom users field.