My question upfront: Is there any currently existing and functioning ways to display a Parent Post while you fill out Child Post form (which has a repeating group, of course) other than this suggested way that is, shall we say, less than optimal to put it mildly. thank you!
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/
Edit to the below: I can't get repeating groups to show a repeating option, even when they are on their own form, at least on the front end. The seen to repeat just fine on the backend, but that isn't what I need.
Background:
I've spent a few hours perusing the past few year's worth of questions regarding repeaters and Parent/Children front facing forms.
I'm abundantly aware that repeater groups can't share a CRED with other fields. However what I'm not presently clear about is which ways exist to connect parent and children post forms.
This one I linked at the top seems to be repeated quite often, and as you all have fully admitted , kind of is not great. Especially since you're not even seeing both on the same page at the same time. Sort of defeats the purpose. And I know you're hard at work on changing this.
But I've seen no less than 20 (!) other solutions on this forum going back a few years. Some involve Views. Some involve functions. There is a fascinating array (ironic and pointed repeater pun intended) of possible solutions that have been posited by you fine folks.
None of these has really worked for me, and that could be user error on my part or Types/CRED versioning made something not work anymore.
What did strangely half-work for me was having both parent and child form shortcodes on the same page, but it appeared that repeating groups didn't work. And I'm actually not quite sure if it saved either after submit (either way I don't think this was the right approach).
I plugged in the below function (sorry about the bad code formatting from a post a few years ago. Not sure if it did anything.
'function current_parent_id_func()
{
global $wp_the_query;
return $wp_the_query->queried_object->ID;
}
add_shortcode( 'current_parent_id', 'current_parent_id_func' );
add_action('cred_save_data', 'my_save_parent_id_func',10,2);
function my_save_parent_id_func($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==88)
{
if (isset($_POST['_wpcf_belongs_my-parent_id']))
{
// add it to saved post meta
update_post_meta($post_id, '_wpcf_belongs_my-parent_id', $_POST['_wpcf_belongs_my-parent_id']);
}
}
}'