Hi,
I would like to add a snipped code for first and last in the registration form but I can’t find the functions.php file in hivepress. I can only find it in listingHive.
Where is it located?
Hi,
I would like to add a snipped code for first and last in the registration form but I can’t find the functions.php file in hivepress. I can only find it in listingHive.
Where is it located?
Hi,
Please use this PHP snippet How to add custom code snippets - HivePress Help Center :
I believe this will be useful to you.
Yes it was helpful and I also added the phone number in the registration form. Now i would like to add that field in the profile view but I don’t know ho to do that.
Can u help us?
Hi,
If you mean to add a field for users, I recommend using user attribute, please navigate to WP Dashboard > Users > Attributes.
Hi, yes i did and it work but now I’m trying to do this:
Code for the phone number in registration form
add_filter(
'hivepress/v1/forms/user_register',
function ( $form ) {
$form['fields'] = array_merge(
$form['fields'],
[
'hp_telephone' => [
'label' => 'Telefono',
'type' => 'phone',
'country' => 'IT',
'required' => true,
'_order' => 5,
],
]
);
return $form;
},
1000
);
add_action(
'hivepress/v1/models/user/register',
function( $user_id, $values ) {
if ( isset( $values['hp_telephone'] ) ) {
update_user_meta( $user_id, 'hp_hp_telephone', $values['hp_telephone'] );
}
},
1000,
2
);
In our website we have the social login plugin and many users used that to log in so they didn’t set up the phone number. I would like to add a controll on that based on the login so I tried to customize a snippets of redirection but it’s not working. Can you help to figure it out?
add_action(
'hivepress/v1/models/user/login',
function($user_id){
$phone_number=get_user_meta($user_id, 'hp_hp_telephone', true);
if ( empty( $phone_number ) ) {
wp_redirect( 'https://domainame.com/account/settings/' );
exit;
}
},
1000,
);
Hi,
Sorry for the inconvenience, but customization is beyond our support scope - it includes fixing bugs and guidance about the available features Support Policy | HivePress
If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.