I have found your documentation about how to set up a form to edit the logged-in user information. I have a client who would like to have a form for Administrators that can search for any WordPress User record, edit and save the update. Is this something that could be built with Toolset? If so, could you point me to any relevant information?
Hello and thank you for contacting the Toolset support.
Depending on how we can implement it and what other features the website would require, I can say, this can be implemented. Because of some limitations, this can't be implemented in a straightforward manner. For example:
- Toolset offers users views to display a list of users. But these views do not support search capabilities. They may be extended with some custom code. The view will use a WP_User_Query instance under the hood. Check this filter https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_user_query
http://codex.wordpress.org/Class_Reference/WP_User_Query#Parameters
- User views are not yet supported by the block editor. They need to be implemented using the legacy editor.
Besides the search capabilities, it is totally possible. In fact, I have implemented an example in a test site. You can log in to it using the following URL hidden link
1. Activate the legacy editor in Toolset->Settings->General(tab)->Editing Experience.
2. Create a view to display the users(you can only select the users' roles). Check the view here hidden link
3. Put the view inside a page, unfortunately, you can't use the view block. You can use a shortcode wpv-view inside a Toolset Fields&Text block.
[wpv-view name="name or slug of the view"]
4. Create an Edit User form and select the roles that you want to edit users for. hidden link
5. Choose where to edit the user:
5.1. On a regular page. We need to pass the user to the form using the user="ID" argument. https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_user_form
5.2. In the author archive page. Usually at hidden link{user_login}
For 5.1. We need to register the wpv-search-term in Toolset->Settings->Frontend Content, in order to use it inside the cred_user_form shortcode.
Check this page hidden link
Notice that I also put the form inside a conditional block, for fun and benefits.
For 5.2. We can render the form inside the author.php file using the cred_user_form. Check the author.php file inside the twentytwenty theme. And check the results for the editor user hidden link
6. Update the user view and add links to the edit form, either on the regular page or on the author archive page. Check my view on this page hidden link
I hope this helps. Let me know if you have any questions.
Wow, that looks like it will be very helpful. I'll try following it carefully and see how far I can get. Thank you so much!