Tell us what you are trying to do?
I try to access the post id of the parent (Field: [cred_field field='@kunde-projekt.parent' class='form-control' output='bootstrap' select_text='---Select customer---' required='false']) after I submit a child post form. However I am not sure, how I have to adress this field appropriately in my php cred_save_data hook. I have tried $_POST['wpcf-@kunde-projekt.parent'], but it doesn't work.
add_action('cred_save_data', 'projekt_update_after_anlegen',10,2);
function projekt_update_after_anlegen ($post_id, $form_data)
{
if ($form_data['id']==1834) {
// I need help accessing the select parent field
$kundenid = $_POST['wpcf-@kunde-projekt.parent'];
$kundenname = get_the_title($kundenid);
update_post_meta( $post_id, 'wpcf-projekt-kundenname', $kundenid . ' / ' . $kundenname );
}
}
many thanks for your help.
However I have encountered a problem. If I access $kundenid in the following way:
$kundenid = $_POST['@kunde-projekt.parent'];
$kundenid is empty.