The child does seem to get attached the first time but I can't repeat the process in the same way as the existing guardians..so I want to be able to keep cresting new guardians through the same process..
So here's what happens when I try it in your login:
Guardians Page - I select CHILD 2 - choose/change Parent
Takes me to website.com/PERSON/CHILD-PARENT/CHILD 2 (the actual url is:hidden link)
I select 'Create New Guardian' which takes me to hidden link
Here I create a new CPT PERSON to become the guardian of the child post that is passed in the url (child_post_id=5116) - The hook we created sets up the parent/child relationship - Then I select submit which takes me back to the 'Guardians' Page...however CHILD 2 now says that CHILD 2 is the parent and not the newly created Parent....
I've isolated the hook and the problem still exists..so there is nothing conflicting...
What is happening is that I create a child here: (e.g. CHILD 1)
hidden link
then go to the guardians page here: hidden link
Then choose the child I've created (choose/Change Parent) - Then create a new Guardian ...
But instead of the Guardian becoming the parent ..the opposite happens i.e. The CHILD 1 becomes the parent of the new guardian....and any subsequent guardians that are created all become children of CHILD 1..
I have set up CHILD 1 for you already ..so if you login and navigate to hidden link
then try to loop through the process of creating a new guardian each time you'll discover the problem...
Ok great....seems like we're moving forward a bit... so what I need in this list is to show the parents name as it does but I need to click on choose/change parent to take you to the selected child's page where you can 'create new guardian' and it will add the new CPT Person an the parent then redirect to the guardians page..
So you form is generating your new parents, with the same slugs.
This is what I believe is causing the issue. So instead of storing the person's name in a custom field, why not just let their name be the post title and add back the post title field to the form that is being used. This will allow the posts to not be created with an autodraft title but rather with an actual title.
Please let me know what you think of this as there is quite a few issues i'm having.
Ok great..that sounds like you're getting somewhere...Can you implement this please... also would this be an issue if by chance there were 2 people with the same name?
But sounds great...thanks for your continued support
I found that the main issue was that on the form the parent information was being set for the guardians as well. I went ahead and deleted that field from the form and made some adjustments so the persons name is stored as the title.