CRED plugin allows you to build forms for front-end user registration and editing. These forms can include user fields and display them with your HTML styling. They also support input validation and automatic email notifications.
When you ask for help or report issues, make sure to tell us the structure and the settings of your form.
Viewing 15 topics - 991 through 1,005 (of 1,046 total)
Problem:
Save CRED generic field into custom user field, for example:
generic field:
[cred_generic_field field='company' type='select' class='' urlparam='']
{
"required":0,
"validate_format":1,
"persist":1,
"default":[],
"options":[ [wpv-view name="cred-companies-as-json-list"] ]
}
[/cred_generic_field]
Save it into custom user field "user_company", which is created with Types plugin Solution:
I suggest you try with CRED action hook cred_save_data to save the cred_generic_field to save it into your database. https://toolset.com/documentation/user-guides/cred-api/#csd
This hook allows doing a custom action when post data is saved to database.
add_action('cred_save_data', 'user_company_func',10,2);
function user_company_func($user_id, $form_data)
{
// if a specific form
if ($form_data['id']==20)
{
if (isset($_POST['user_company']))
{
// add it to saved user meta
update_user_meta($user_id, 'wpcf-user_company', $_POST['user_company'], true);
}
}
}