У меня есть функция, которая должна обновлять мета-поля клиента данными, полученными из формы плагина конечного участника.К сожалению, это не работает.Вот код:
add_action ('um_post_registration_save', 'custom_update_profile',99, 2);
function custom_update_profile ($user_id) {
/*$user_id = um_profile_id();*/
global $ultimatemember;
um_fetch_user( $user_id );
$profilefirstname = um_user( 'first_name' );
update_user_meta( $user_id, 'billing_first_name', $profilefirstname );
$profilelastname = um_user( 'last_name' );
update_user_meta( $user_id, 'billing_last_name', $profilelastname );
$profilecompany = um_user( 'business_name' );
update_user_meta( $user_id, 'billing_company', $profilecompany );
$profileaddress1= um_user( 'street_address_1' );
update_user_meta( $user_id, 'billing_address_1', $profileaddress1 );
$profilecity= um_user( 'city' );
update_user_meta( $user_id, 'billing_city', $profilecity);
$profilestate= um_user( 'state' );
update_user_meta( $user_id, 'billing_state', $profilestate);
$profilezip_code= um_user( 'zip_code' );
update_user_meta( $user_id, 'billing_postcode', $profilezip_code);
$profilecountry= um_user( 'country' );
update_user_meta( $user_id, 'billing_country', $profilecountry);
$profileemail= um_user( 'user_email' );
update_user_meta( $user_id, 'billing_email', $profileemail);
$profilephone= um_user( 'phone_number' );
update_user_meta( $user_id, 'billing_phone', $profilephone);
$profilepassword= um_user( 'haslo' );
update_user_meta( $user_id, 'user_password', $profilepassword);
return $user_id;
}