Skip to:
Content
Pages
Categories
Search
Top
Bottom

Edit bp-members-functions.php to include Username


  • RaMatheron
    Participant

    @ramatheron

    Some of my users were having trouble logging in after they registered using a space in their username. This meant that the space would be changed into a dash, but this wasn’t clear to the users.

    A good solution would be to include the corresponding username in the activation e-mail. I’m almost sure this can be done in the bp-members-functions.php file, but I have no idea how.

    Here’s the code I think needs editing:


    function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) {

    $activate_url = bp_get_activation_page() .”?key=$key”;
    $activate_url = esc_url( $activate_url );

    $from_name = ( ” == bp_get_option( ‘blogname’ ) ) ? __( ‘BuddyPress’, ‘buddypress’ ) : esc_html( bp_get_option( ‘blogname’ ) );

    $message = sprintf( __( “Thanks for registering! To complete the activation of your account please click the following link:nn%1$snn”, ‘buddypress’ ), $activate_url );
    $subject = ‘ ‘ . __( ‘Activate Your Account’, ‘buddypress’ );

    // Send the message
    $to = apply_filters( ‘bp_core_signup_send_validation_email_to’, $user_email, $user_id );
    $subject = apply_filters( ‘bp_core_signup_send_validation_email_subject’, $subject, $user_id );
    $message = apply_filters( ‘bp_core_signup_send_validation_email_message’, $message, $user_id, $activate_url );

    wp_mail( $to, $subject, $message );

    do_action( ‘bp_core_sent_user_validation_email’, $subject, $message, $user_id, $user_email, $key );
    }



    I’m also using the ‘BuddyPress Usernames Only’ plugin, if that’s useful information.

    Can anyone help me?

    Thanks in advance,
    RaMa

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Edit bp-members-functions.php to include Username’ is closed to new replies.
Skip to toolbar