Tell us what you are trying to do?
I would like to pre populate certain fields in the child form using custom filed values from the parent post type.
Parent post type = Job
Child post type = Application
Is there any documentation that you are following?
No
Is there a similar example that we can see?
No
What is the link to your site?
hidden link
Hello and thank you for contacting Toolset support.
It seems that you are already setting the parent post using a URL parameter(parent_job_id=26), right?
If that's the case you can use it in the item attribute to get the value of the field, and directly pass it to the value of the field. For example:
[cred_field ..... value=[types field="the-field" item="[wpv-search-term param="parent_job_id"]"][/types]"]
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
However, Toolset does not allow 3 levels of nested shortcodes. So, you will need to register your own shortcode to pass the value:
[cred_field .... value="[your-shortcode]"]
And register the shortcode with something like:
add_shortcode('your-shortcode', function(){
$parent_id = do_shortcode('[wpv-search-term param="parent_job_id"]');
return wpv_do_shortcode('[types field="the-field" item="' . $parent_id . '"][/types]');
});
Please note that I did not test the shortcode. It is meant to explain the idea to you. I hope it makes sense.
Thank you for your help on this. It sort of worked but found it easier to embed the form into the job posts as opposed to linking to a new page.