BuddyDev

Search

[Resolved] Better Registration Guide still accurate?

  • Participant
    Level: Initiated
    Posts: 10
    Psycho on #41207

    Hi,

    my users are regularly confused because they have to enter a name twice during registration. the difference between username and display name is difficult to convey to normal users.

    so i was looking for a way to simplify buddypress registration and found the guide here:

    https://buddydev.com/buddypress-better-registration-part-1-remove-full-name-confirm-password-from-buddypress-registration/

    should the code from the guide still work?

    hiding the fields with css works perfectly. however, the registration cannot be completed (click on “complete registration” does nothing).

  • Participant
    Level: Initiated
    Posts: 10
    Psycho on #41208
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41209

    Hey There Psycho,
    I Think that Should Work Perfectly Even Now.

    Go Ahead And Give it A Try 🙂
    Cheers, Cromacio

  • Participant
    Level: Initiated
    Posts: 10
    Psycho on #41210

    a copy of my private answer (no idea why I checked the private box …)

    ***
    Link to the registration form: https://staging-psycholol.kinsta.cloud/registrieren/

    Additional CSS

    form div.field_1 {
    	display:none !important;
    }
    #buddypress .standard-form  label[for="signup_password_confirm"],
    .register-section  #signup_password_confirm
    {
    	display:none !important;
    }

    added to BuddyX Version: 4.2.4 function.php

    function buddydev_inject_username_as_fullname() {
    	$_POST['field_1'] = $_POST['signup_username'];
    	// disable confirm password.
    	$_POST['signup_password_confirm'] = isset( $_POST['signup_password'] ) ? $_POST['signup_password'] : '';
    
    }
    • This reply was modified 2 years, 5 months ago by Psycho.
  • Participant
    Level: Initiated
    Posts: 10
    Psycho on #41212

    unfortunately not on my site … complete registration button remains inactive …

    but it is good to read that the solution should still work. hope it will work on my side as soon as someone with a little more idea takes a look 🙂

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41213

    Hi Psycho,

    You Added the Function, but You Forgot to Call the Function
    Add This-

    
    
    add_action( 'bp_signup_pre_validate', 'buddydev_inject_username_as_fullname' );
    
    

    Also, I Think The Step 3 Mentioned Here- https://buddydev.com/buddypress-better-registration-part-1-remove-full-name-confirm-password-from-buddypress-registration/ could be Added too.

    
    
    function buddydev_disable_fullname_required_attributes( $atts, $field_name ) {
     
        global $field;
        $fullname_field_id = 1;
     
        if ( $field && $fullname_field_id !== $field->id ) {
            return $atts;
        }
     
        foreach ( $atts as $key => $value ) {
            if ( 'required' === $value ) {
                unset( $atts[ $key ] );
                break;
            }
        }
        return $atts;
    }
     
    add_filter( 'bp_get_form_field_attributes', 'buddydev_disable_fullname_required_attributes', 10, 2 );
    
    

    Hope That Helps.. 🙂
    Cromacio

  • Participant
    Level: Initiated
    Posts: 10
    Psycho on #41214

    It works! You (and the author of the guide of course) totally saved my day.

    so awesome that it works now. never again unsuccessful attempts to explain the difference between usernames and nicename and displayname to an inexperienced user.

    thank you so much!

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41215

    Glad to Know that 🙂
    Cromacio

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #41224

    Hi Cromacio,
    Thank you for the assistance here.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved