Hello support team,
The signed in user can create new objects using the CRED Post Form.
I want this Form group to be preselected based on the signed in User:
<div class="form-group">
<label>Übergeordnet zu artist</label>
[cred_field field='_wpcf_belongs_artist_id' value='' class='form-control' output='bootstrap']
</div>
I try to get the drop down to be pre selected, based on the signed User.
Hello,
I assume we are talking about a CRED form for creating child post, you are going to setup the default value of field "_wpcf_belongs_artist_id", if it is, you can add attribute "urlparam" to shortcode [cred_field], for example:
[cred_field field='_wpcf_belongs_artist_id' value='' class='form-control' output='bootstrap' urlparam='artist_id']
Then pass URL parameter to your CRED form, and specific the default "artist" post ID, like this:
hidden link
More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
Thank you for the response.
How do I pass the URL parameter to my CRED Form?
For the question :
How do I pass the URL parameter to my CRED Form?
For example:
1) Create a wordpress page
hidden link
use it to display the CRED form for creating child post
2) in a single "artist" post, Setup a link to above page like this:
<em><u>hidden link</u></em>
Done that, but the ID that is passed is not assigned to any post.
The ID that is passed is 2072, the ID that the WP-User is assigned to is 1989.
Why is it passing the wrong ID?
I have went trough all Posts not only artists but also objects and the ID is not assigned to any post.
I tried it with diffrent WP-Users, the ID is always the same.
It is abnormal, the shortcode [wpv-post-id] should be able to output current post ID, please check this in your website:
in case there is any compatibility problem, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a test site with same problem, fill below private detail box with login details, also point out the problem page URL and CRED form URL, I need a live website to test and debug, thanks