Reply To: Member Registration Form – Dynamic Member ID and Validating email

Home Forums Quform WordPress Member Registration Form – Dynamic Member ID and Validating email Reply To: Member Registration Form – Dynamic Member ID and Validating email

#28485
harish
Participant

Hi Thank you for the example,

We did try implement it. But the Field IDs are editable by the user and we can’t use field ids to login instead of username.

So, instead of user input for username, we want the username itself to be the member ID that automatically increments. So, no one can change the member ID and the user can login using the member ID (as username).

add_action('quform_post_process_1', function (array $result, Quform_Form $form) {
    if (function_exists('bp_core_signup_user')) {
		$username = $form->getValueText('quform_1_45');
        $email = $form->getValueText('quform_1_6');
        $password = $form->getValueText('quform_1_44');
 
        // Profile fields
        $usermeta = array(
			'field_1' => $form->getValueText('quform_1_4'),
            'field_2' => 'kr' . $form->getEntryId(),
        );
 
        $usermeta['profile_field_ids'] = '1,2';
        $usermeta['password'] = wp_hash_password($password);

we would like to assign ‘kr’ . $form->getEntryId() to the $username

add_action('quform_post_process_1', function (array $result, Quform_Form $form) {
    if (function_exists('bp_core_signup_user')) {
		$username = 'kr' . $form->getEntryId();
        $email = $form->getValueText('quform_1_6');
        $password = $form->getValueText('quform_1_44');
 
        // Profile fields
        $usermeta = array(
			'field_1' => $form->getValueText('quform_1_4'),
        );
 
        $usermeta['profile_field_ids'] = '1';
        $usermeta['password'] = wp_hash_password($password);

But when we try to use the modified code, it won’t work.

All we need now is to assign the $username to ‘kr’ . $form->getEntryId()
So, users can use the kr{entry_id} as username.

Is there anyway you can help us pleaseeee?? if this is solved, we can close this ticket.

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy