I have a situation where I have members amd clubs and am creating a many to many relationship via a third table called memberships.
To do this I want to add a simple button on the club page that is a CRED form that pre-selects all of the fields needed to create the link.
I can do all of the following:
- pre-define the post title
- pre-define the post slug
- pre-define the default values for membership data fields
- pre-define the club parent
- eliminate all space taken up by the above
- display the create button
What I cannot work out is how to automatically define the member parent.
What I think I need is some sort of shortcode that enables me to embed the member_id in the member parent CRED field.
I can get this value via a VIEW as follows:
NORMAL VIEW
Members, ordered by post date, descending, limit to 1 item
Select posts with the author the same as the current logged in user
VIEW LAYOUT
Unformatted
Field= ID
Because I have a Member/user relationship I am able to select the relevant member record but what I cannot do is plant that value in the CRED form.
==========
[cred_field field="_wpcf_belongs_member_id" value=""]
==========
What I am trying to achieve is a situation where the user does not need to select any parents to create the many to many relationship. To do so would involve selecting from 100+ clubs and 2000+ members!!
I hope that I have explained this sufficiently – any help much appreciated.
(I checked the book review example http://wp-types.com/documentation/user-guides/cred-forms-for-child-content/ but this only handles the pre-selection of the book – I assume that to identify the reviewer, the user needs to select themselves from the list of reviewers)
Tony