This support ticket is created Il y a 4 années et 7 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
It works great - but is there an option to show not the display_name, but a custom field? such as my clinic-name? when I insert this instead of "display_name" i get nothing.
I'm not trying to get the current user, I'm trying to get a list of all users.
It worked before, the only thing that I wanted to change was that the options in the select box will display not the username, but the custom field "clinic-name").
Thanks for writing back and sorry if my message caused confusion.
When I wrote "You can use this inside your shortcode's loop", I meant inside the "foreach { ... }" block.
( screenshot: hidden link )
That "foreach" block is cycling through the user's list one user per iteration, which means that in each loop's iteration "$user->ID" will return the ID of a different user in that list.
( this is what I referred to as the current user and not the currently logged-in user )
Note: with the current position of $field_value, you're only getting currently logged-in user's value because at that point $user->ID is not defined and "user_id" gets a blank value, and the "types_render_usermeta" function falls back to return the value from the currently logged-in user.