Skip Navigation

[Closed] Assign post type data to a user

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.

This topic contains 3 replies, has 2 voices.

Last updated by Christopher Amirian 10 months, 3 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2686972

I have a post type and the data for it created with a form I would like to assign to a specific user. Now, it would be great if I could use the Author field which is already there, but I know they have to be Authors, which is not the case.

So, somehow I would like to add a field on the type that contains the user but I can't seem to create a relation to users on the object type through custom fields.

My question is, how do I solve this matter? What I'm doing is creating ENTRIES for a user and I want to be able to assign to a specific user so they can see it. All I need help with is figuring out how to get a user dropdown, preferably type ahead or another search, and then submit a form to assign the Post I created to that user.

#2687137

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Unfortunately, it is not possible to do so as there is no relationship between users and posts as they are completely separate entities.

Usually, the way Toolset handles users with additional information is to create a specific post type which will act as the additional information for a user and then see the user in question as the author of that post.

But your use-case seems to be different. I am not sure if it is possible but maybe you can use the method above to have a post for each user and then use the relationship between that post type and your post type to create the connection.

You can learn more about the user <> post relationship workaround I mentioned originally here:

https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/#support-for-users-in-toolset-and-wordpress

Thanks.

#2687174

Hi, thanks. I already have something similar to that setup. I just need a dropdown of the users, i.e. a select with first name, last name, and user id as value, is that possible?

#2687269

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

No it is not possible, the only thing possible is to show the intermediary posts (the one I already mentioned that has the users the author) shown if you set a relationship between those intermediary posts and the post in question.

That will be a standard relationship for according to this documentation:

https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/

Thanks

The topic ‘[Closed] Assign post type data to a user’ is closed to new replies.