That is strange as nothing was done to the site and it was working before. Usually in a case like this . I would go through one by one again.
Removing all the existing functions and testing each individually. The good thing is that we know what was causing your initial issue of the duplicates but now we don't know what is causing your functions to stop working.
So I would remove them again and test them. Secondly if you have installed any plugins or updated any plugins I would recommend disabling those as well while performing the test.
I'm tracing through the diagram and testing as I go along.
First thing I want to confirm is that the $user_will_url is this correct hidden link
That is just an example.
After filling out the form here. hidden link
I was redirect as according to the hook that you have for this form, so this hook works.
So it seems from further checking, the id's from your diagrams are not the ID's of the forms. For e.g your Create new Guardian form here. hidden link
The ID is 1797, in your diagram you have it as 1787. Then checking the corresponding hook based on the function name, this is what I see.
add_action('cred_save_data','func_update_parent_field',10,2);
function func_update_parent_field($post_id,$form_data) {
if ($form_data['id']==4049) {
wp_update_post(array('ID' => $_REQUEST['child_post_id'], 'post_parent' => $post_id ));
update_post_meta($_REQUEST['child_post_id'],'wpcf-adopted',$_POST['wpcf-adopted']);
}
}
Where the form id is 4049, however based on your forms the actual ID of the add guardian form is 2613
So it seems your ID's are not matching the actual forms based on the hooks being used. This is just one example of what I could find.
You're more familiar with this setup than I am so I could've just looking at the wrong Items but this is where I would start. I would ensure that the ID of the hook matches the ID's of the forms themselves.
Your layout is saying that the form is the "Create New Guardian form" with the ID 1787, however on the frontend the form's id is "2613" which is the "Add New Guardian" form.
Also Shane...when I try to repeat the step from page 'guardians' i.e. click 'Choose/Change Parent' to change to a new guardian I get different PEOPLE sent through...it alternates between:
hidden link hidden link
So consequently the new parent doesn't get attached to the child
Here is the actual pattern of urls when repeating the step:
Firstly apologies for the multiple posts to you..I've just been adding my additional thoughts since we last spoke.
Obviously there is still the problem of why I reference one form ID in the layout and get another form ID on the front end...but also I think the WordPress parent/child hierarchy is causing issues as mentioned above.
When on the Guardians page the a href link when choosing the child is created by the slug of the child selected..so for example this could be hidden link
However when a parent has been assigned the slug of the child has changed to hidden link
And I think this is what stops you assigning a new parent...I think I need to either display the slug without the parent extension or somehow remove the parent first before assigning the next..
This is something that I need to sort out fairly quickly as it is holding up an already delayed development timeline. Also this is a singular form but I need to repeat this parent/child adoption for many other variants of PERSON CPT e.g. Child needs a guardian, Pet needs an Owner, Gift needs a Beneficiary... Child, Guardian, Pet, Owner, Gift and Beneficiary are all PERSON CPT to allow me to create this parent/child relationship...
Is there a time of day when we can speak on the live chat to try and sort this out as waiting 24 hours each time between messages is taking too long..
An example would be the page: hidden link
Where it used the layout: People New Guardian and within the layout sits the form Create New Guardian (ID: 1787) - But on the front end it seems to use the form ID 2613
Perhaps if you could look at why this is happening first please...