I want to have a dropdown field on a form that will give the option of selecting the name of an existing user, is there a way to do that? It won’t be the name of the person filling out the form, but the person that referred them. I found wp_dropdown_users() in Wordpress and can make a dropdown box that looks exactly like I want, but I can’t find how to integrate that into my Gravity form, or how to use Gravity to produce the same effect.
Hi techiechic. You can populate a drop down field in the form using several different methods. The easiest way is to use the Populate Anything plugin from Gravity Wiz:
That way requires no code, but it is a paid plugin.
If you would like to use the PHP filters, please take a look at this article:
That example uses the WordPress function get_posts in the code, but you can switch to any of the WordPress functions available to get the users (probably NOT wp_dropdown_users, because that will return a drop down, and we only want data.)
If you have any questions about which direction to take, please let us know. and we’ll give you our best advice to get it done. Thank you.
You guys are awesome! Thank you so much for a quick and thorough response. That was exactly what I was looking for
Awesome. Glad that worked out for you. Let us know if you need anything else.