I have an edit user form with ID=2328. On the form is a single select option with either 'Yes' or 'No' (asking Do I have children?)
If the user selects 'No' then when the form is submitted I want a hook that performs these tasks:
1. Find all CPT 'People'(that have been created by the current logged in user) where the Field value of these people 'Child' = 'Yes'
2. Replace the field value of 'Child' with 'No' and save
I thank you in advance for your help and time with this..
I have followed your instructions and the code is not working...The only things I changed were I added a ' that was missing after func_update_child_field_values,10,2) and I changed the CPT to 'Person' rather than the plural 'People'...is this the right thing to do?
I've added it to the custom code section but the function won't fire..
Ok - can you please share problem URL where I can see the profile form and admin access details.
Also, please setup a user who already have few people posts with 'Child' field where value set to Yes and send me that user access details as well, so I ca use this user for testing.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Can you please check now. The issue why the code was not fired because the code snippet you added but not activated. I've activated it and adjust the code as required.
I've adjusted the code as given under:
=> lien caché