[Resolved] Populate a select field in a form, with available users from WordPress.
This support ticket is created 2 years, 6 months ago. 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.
I'm want to build a simple form for a secure (intranet-like) site where the employees should be able to change their working shifts.
Basically, anyone who has logged in should be able to visit a page called "Change work-shift" and on that page, they should see a list of already made "posts" of work-shift changes.
A logged-in employee should be able to add the following using a form:
Job date
Shift type: Morning, Afternoon, Night
Change from: Username/employee
Change to: Username/employee
What is the best way to solve this? I'm thinking...
-A custom post type called "Work shift"
-Custom fields for that CPT
-Then a new page to show a view with already created work-shifts + the form to add more
???
The code snippet from the other ticket is ready-to-use for your requirement too. You'll only need to replace "Book User" with the select type field name used on your website and the "subscriber" role, with the target role of users, you'd like to include in the list.
For more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/