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.
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.
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?
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