I need to build a many to many relationship between Events (workshops) , speakers and participants. Most of speakers and participants are WP users. There is any way to create a post type, ready for Parent / Children relationship using the users list?
In other words, if i create a Participants Post type i have to enter manually a duplicate of existing users in order to create a Parent / Children relationship with Events Post type ?
I can't relay only on users subscriptions, i need also the option to attach by form a number of them to a workshop.
I created a PostType Event-Author but adding one by one this Post Type to create relationship is not very convenient.
Could you please help?
Many thanks - Federico
Dear Federico,
There is built-in Many-to-Many relationships in Types plugin, please check our document:
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
Creating and Displaying Many-to-Many Post Relationships
Dear Luo,
thanks for your reply, i read the article but in the example the relationship is between bands, events and appearances, that are all Post types.
What i am looking for is a way to replace , let's say, bands with WP users.
I know that a logged user can subscribe an event, what i need is a form where an operator could associate users to events smoothly. Basically a way to build a combobox displaying users and use it
in the Relationship form (see image attached)
Many thanks,
Federico
I assume we are talking about this:
You are going to setup many to many relationships between Post type "Events" and wordpress users
There isn't such a built-in feature within Types plugin.
But there is a workaround:
You can create a custom multiple instance select field, use Types filter hook wpt_field_options to populate the options as the wordpress users, for example this thread:
https://wordpress.org/support/topic/user-select-field
For your reference
Dear Luo,
sounds interesting!
Could you please clarify: so i should add an hook in functions.php based on https://wordpress.org/support/topic/user-select-field , then should i create a User fields group with a multiple instance select field?
And how can i call the hook from the custom multiple instance select field ?
I read here https://toolset.com/documentation/user-guides/using-custom-fields/ but it is not explained
Could you suggest some documentation to follow?
Many thanks,
Federico
I tested it in my localhost, there isn't multiple instance option for custom select field.
But in your case, you need multiple instance fields. so I suggest you try this:
1) Create tow custom post types: speakers and participants
Setup each speakers and participants post's author as different wordpress user.
2) setup many-to-many relationships between post types:
Events and speakers
Events and participants
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
3) In the single Event post, display the related speakers and participants, see above document, section "Displaying Many-to-Many Relationships Using Views",
display the wordpress user information with Views shortcode [wpv-post-author]
https://toolset.com/documentation/views-shortcodes/#wpv-post-author
Hope it help
Many thanks , i finally simplified my model and decided to use the Author of the post in a standard way.