I would like to create a relationship between my two custom post types 'client' and 'dog' in the front-end using a form by formidable forms
I have successfully setup relationships between the two custom post types in the backend by using the new toolset betas for types and views. The relationships work correctly.
But I am not sure how to make my form write to it.
Or: is there a way to allow a front-end user the same functionality as in the admin section of the cpt (see screenshot below)? If my frontendusers could add dogs directly from the front-end like that and they would get connected automatically to him that would be perfect.
Hello. Thank you for contacting the Toolset support.
Well - As we just released the M2M Beta, there is still lot of work to be done and lot of changes will be expected before be release the stable official release. Also, there is no API available yet to connect the post automatically.
I recommend you to use current stable Types (All Toolset) plugins for now and build your relationship using current stable Types version as to use Beta is not recommended.
To connect parent and child with current stable version, When using Types posts relationships, the parent of a given type is stored in a field:
_wpcf_belongs_{parent-posttype-slug}_id
For example:
Let’s assume that we are displaying a "Car" (child) post type that has a "Maker" (parent) as a parent post type.
- Each Car (child) post will store its Maker (parent) id in the field: _wpcf_belongs_maker_id