Skip Navigation

[Resolved] Confirm. this is only *current* way to connect Par./Children infront facing form

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Author
Posts
#876630

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']);
}
}
}'

#876659

I see that you use the current stable Toolset and API, hence, repeating field groups do not exist.

Not in the sense of proper repeating field groups as they exist now in Toolset RC-2 (downloadable in the beta area of the Toolset Downloads page of your account) and future releases.

Hence I have 2 proposals:
- either you give a try to the new RC versions which include some new features in regard and check out if you like it, and what you would miss
- or, I can help you with this project and approach, although given that some API will change, it may then be necessary to afterwards edit a few details (after Toolset is released with the next version)

Please let us know if you could think of proceeding on a staging site using the RC versions!

#876747

Thanks- I'm actually down with the latest betas (I'm all over that), just got them directly from WP-Admin -->Commercial.

Using all the RCs. If you can just give me a couple of hints or direct me to a non- "go-to-a-different-page-to-update child repeater" posts, that would be great.

I'm on Types 3.0-RC2 (Beta) , Views 2.6-RC3 (Beta) & the artist formerly known as CRED 2.0-RC2 (Beta) .

#876980

yeah definitely looks like I cant get repeater blocks to repeat regardless of circumstance (among my previously mentioned issues). Real repeaters can't come soon enough. The future of WordPress is front end and user (not admin) driven with more complex data types. It's never made sense that you can duplicate one field at a time to infinity and beyond in Toolset, but you can't duplicate a block of fields. They both result in arrays.

#878483

I was able to sorta kinda resolve this by incorporating jquery repeater groups into toolset.