Skip Navigation

[Resolved] "Todo List" like User->Task Connection

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

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1139197
todo.jpg

>Tell us what you are trying to do?
a todo list like application which can be edit in the frontend & is connected to users.
the logged in user can then attach tasks to another user

My problem here is:
how can i integrate a "selection field" with all currently registred users in "Custom Post Type" (Todo: Add New Task) Frontend Form. And connect then the Tasks to the user.

>Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

Thank You for looking in to it.
Best regards
Sammy.

#1139814

how can i integrate a "selection field" with all currently registred users in "Custom Post Type"
Hi, there are 2 basic ways to connect Users and Posts:
1. Make the User the author of the post.
2. Create a Custom Post Type (something like "Workers") that represents Users, and connect Workers and Tasks using a post relationship. I call this a "proxy" post type.

#1 is more difficult because changing the post author requires custom code. You must create a generic field in your Form. The generic field must include options created by a View of Users. Then you must use the Forms API to set the author of some post to match the User selected in the generic field.
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://codex.wordpress.org/Function_Reference/wp_update_post

#2 requires no custom code, but it requires two custom post types: Tasks and Workers. Set up a one-to-many post relationship between Workers and Tasks. Workers should be parents of Tasks.

When Users sign up, they must create a new Worker post like in the documentation: https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/#how-do-i-prevent-users-from-creating-more-than-one-contractor-post

Then when a Task is created or edited using Forms, any User can choose a different Worker as the parent of the Task.