I am trying to: include usermeta on the edit user cred form
I expected to see: i tried using the 'generic field' and used the field "billing_address_1". is blank and doesnt save data to user.
Instead, I got: I also tried <wpv> but only get the logged in user data
Dear tims,
I assume the custom user field is created with other plugins/theme, you are going to edit it's value with CRED form, please try this:
1) Activate Types plugin, you can download it here:
https://toolset.com/account/downloads/
2) Dashboard-> User Fields,
click button "User Field Control", find the field "billing_address_1", click link "Manage with Types"
3) Edit your CRED form, click button "Add User Fields", you will find the field in section "Custom Fields"
This still created the field as wpcf-billing_address_1
It should not create new custom user field "wpcf-billing_address_1", see our document:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/
Please check if you have create a custom user field "billing_address_1" with Types plugin, if it is, you will need to remove it, and test again.
If the problem persists, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) provide a database dump file of your website in below "private detail box", also point out the problem page URL and CRED form URL, I need a live website to test and debug. thanks
Since you provided only the website credentials, but did not provide the database dump file, so I need your permission to deactivate plugins and switch theme in your website, please backup your website database first.
And I tried the open the problem page:
hidden link
It display only a password window:
Protected site, it needs the password. please check it, thanks
Yes, permission to play.
Password: BBS2017
Thanks for the details, I am checking it in your website, will feedback if there is anything found
Here is what I found, it should be a bug of CRED plugin, and I have put it into our to-do list, our developers will take care of it.
Currently, here is the temp workaround, you can try this:
1) Add a custom user field "billing_address_1" with Types plugin, in database the field slug is "wpcf-billing_address_1", which should be able to be edited by CRED form without problem,
hidden link
2) When user edit it with CRED form, use CRED action hook "cred_save_data" to trigger a PHP function, in this PHP function, get the user field "wpcf-billing_address_1" value, and use it to update the user field "billing_address_1" value
for example, you can add below codes into your theme/functions.php:
add_action('cred_save_data','my_func_4',10,2);
function my_func_4($post_id,$form_data) {
if ($form_data['id']== 151946) {
$billing_address_1 = get_user_meta($post_id, 'wpcf-billing_address_1', true);
if($billing_address_1){
update_user_meta($post_id, 'billing_address_1', $billing_address_1);
}
}
}