User CPT settings for automatic Relationship
-
Hello,
I have created a relationship between Users (extended) and their CPT posts, let’s say “Diaries”.
I want that when a user submits a form (using WPForms) with their post, to be automatically recognized in relationship with their posts. I have succeed this once but I cannot find the solution again 🙁So, I have created a field “xAuthor” in Diaries as follows:
- Field Details: Relationship; Users
- Relationship Options: Single Select, Autocomplete; Allow Add New = No
- Advanced: Default value = {@user.id}
In Users, I have created a field “related_posts” as follows:
- Field Details: Relationship; Diaries
- Relationship Options: Multiple select; Autocomplete; Allow Add New – Yes
- Advanced: Default Value = {@id} // or nothing
Everything works if I test the relationship from the Admin area (I choose an user for a Diary or I select one or more Diaries for a User).
However, it does not work automatically when a user submits the form, the xAuthor is null and their Diary is without xAuthor. What settings should I do in PODS to get the current user automatically for the field xAuthor?
I have succeeded once…! but unfortunately I lost my settings and I cannot redo it.
The topic ‘User CPT settings for automatic Relationship’ is closed to new replies.