This support ticket is created 7 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
So once you create the custom field in Types then you just write the hook like this
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==12)
{
update_post_meta($post_id, "wpcf-custom-field", "value to add");
}
}
}
Add the above your functions.php file change the 12 to the ID of your CRED form. Also you will need to change the wpcf-custom-field to the slug of your custom field keeping the wpcf- prefix and finally setting the value to add.
Please let me know if this helps.
Thanks,
Shane
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.