I have a content template for a CPT called Listing, which has a parent-child relationship with Related Projects.
Users create draft Listings which need to be approved prior to changing the status to publish. While the Listing is in draft the user needs to add Related Projects.
On the content template for Listing I have inserted a cred form to add a related project. The user can add a Related Project, but the new child record is not connected to the parent.
I have temporarily placed the join field on the form so that I can see if it is being connected to the parent record:
[cred_field field="@listing-related-project.parent" class="form-control" output="bootstrap" select_text="--- not set ---" author='$current']
The dropdown only displays Listing posts that are published. Could this be why the child posts are not being connected to the parent?
It doesn't mention whether there is a prerequisite that the parent post be published. Is there a hack I can use so that a child post can be connected to a draft parent post?
Perhaps this should be on the features list for development?
We've worked out a way to achieve the desired result. The form is nested on the Content Template and the url contains the ID of the parent post. We've added "urlparam='p'" to the shortcode:
[cred_field field="@listing-related-project.parent" class="form-control" output="bootstrap" select_text="--- not set ---" author='$current' urlparam='p']