Tell us what you are trying to do?
Each user has a Profile custom post with their full details.
Users can create an Exhibition (another custom post type) for listing.
When displaying the Exhibitions to the public, I want it to display info from the Profile of the Author.
I think I can do it using a Relationship, but each user needs to link each Exhibition as they create it to their Profile.
I want it to do this automatically based on the Author of the Exhibition post.
Hello. Thank you for contacting the Toolset support.
What if you create a one-to-many post relationship between your post type "Profile" which holds your user profile information and post type "Exhibition".
Now, when user create a new Exhibition, you should link the Exhibition post with the user profile post.
If you can share access details and tell me where you added the form using which user can create Exhibition post and send me access details of admin user as well as frontend user using which I should create Exhibition post using Toolset form I will review your setup and make the necessary adjustment or if you know how to do it, you should go ahead and apply such changes to your form.
Please let me know if you will require further assistance.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I've added the Toolset form's hook "cred_save_data" that will allow use to find the current loggedin user profile post and using Toolset Post-relationship API function: toolset_connect_posts() we will conntect the profile post with the Exhibition post.
I've added the following code to "Custom Code" section offered by Toolset:
=> hidden link
I'm not entirely sure how this works, but my issue is resolved now. Thank you!
Hopefully this sort of thing can be done in future versions without coding...
Hi. I am trying to do this same thing with another custom post type. I have duplicated the custom code as below but it isn't working. Any idea where I have gone wrong?
I have updated the function name, form ID and the toolset_connect_posts name
thanks
add_action('cred_save_data', 'func_connect_profile_with_report',10,2);
function func_connect_profile_with_report($post_id, $form_data){