Skip Navigation

[Resolved] Question about an Admin form to edit any user record

This support ticket is created 3 years, 8 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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by brianC-5 3 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#2009783

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?

#2009971

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.

#2010025

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!