Hi, please help me solve the problem. By Request the phone number in the subscrition form We decided to create a phone number login for all types of users, but the phone number is not saved if you enter it during registration. Here is a screenshot of the seller and user attribute settings using another plugin.
Both attributes look like this
And snippet
add_filter(
'hivepress/v1/forms/user_register',
function ( $form ) {
$form['fields'] = array_merge(
$form['fields'],
[
'hp_telephone' => [
'label' => 'Phone number',
'type' => 'phone',
'required' => true,
'country' => 'RU',
'_order' => 1,
],
]
);
return $form;
},
1000
);
add_action('hivepress/v1/models/user/create',
function ($user, $values) {
if (isset($values['hp_telephone'])) {
update_user_meta($user->get_id(), 'hp_hp_telephone', $values['hp_telephone']);
}
}, 1000, 2);
and we used this code