I have created a staff portal and want people to be able to fill in forms without having to re-enter their details every time.
I have set up a user login with username realname etc.
I have a CPT called Profile which holds phone, address, etc
I have set up a CPT called documents where they upload documents for all logged in users to read
In the Form for uploading documents, I would like the name of the staff member name to automatically go into the name field. Is there a way to do this?
I would like to use this feature extensively through the site with different fields from the profile CPT
For the fields in your form you can provide a default value (in the GUI when editing the form in visual mode, by adding a value attribute when editing in expert mode).
You can use shortcodes to generate these default values.
This is straightforward if the fields are part of the user profile (either standard fields such as Display Name or email, or custom fields).
You would use the wpv-user shortcode to provide the default value from the current user (i.e. the person submitting the form), e.g.