This topic has 17 replies, 5 voices, and was last updated 10 years by Abe.

  • Author
  • #10201
     Globetrekker
    Participant

    As many others, I would also like to get rid of the “full name” profile field in registration, members, profile and everywhere else on my site.

    I know, there are a lot of post regarding this topic, but honestly, I find it extremely confusing with all these different forum topics, and I honestly don’t know where to start. As I know a lot more of your customers want to use usernames and remove full names for their sites, it would be fantastic with a guide on how to do this. This could be the guide on how to do this – I think it would save you guys and your customers a lot of time.

    Appreciate your help,
    Thanks

    #10310
     Abe
    Keymaster

    Hello, You can add this plugin or use just the code from this link in your sweetdate-child/functions to remove the Full name
    https://github.com/daankortenbach/buddypress-remove-xprofile-fullname-field/blob/master/buddypress-remove-xprofile-fullname-field.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #10318
     Globetrekker
    Participant

    Thanks Abe..

    I tried to just copy all the code from the link and added it to the bottom of sweetdate-childe/functions, but I guess I do it the wrong way, cuz it comes up with some serious errors..
    Can you state where exactly I have to add it? Should I add it between some lines of codes or should I only copy some of the code from the link? Right now, I copy everything – black, green and red text. Is this wrong?

    Thanks

    #10364
     whinds
    Participant

    please ignore – i responded to wrong issue

    #10367
     Globetrekker
    Participant

    Still looking for an answer to my question though 🙂

    #10452
     Globetrekker
    Participant

    Still looking for some help on this issue Abe.. Please advise. Thank you

    #10552
     Abe
    Keymaster

    Hi, you should get everything starting from
    add_filter( ‘xprofile_group_fields’, ‘dk_bp_remove_xprofile_fullname_field’, 10, 2 );

    and put it in the functions.php file at the end of the file before the ending ?>

    or if you can’t seem to do it right, just copy the file in your wp-content/plugins folder and activate it as a regular plugin

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #10781
     Globetrekker
    Participant

    Hi Abe,,

    Thanks.. I have tried both options now. Both in Functions.php and also uploaded it as a Plugin.
    Every time I activate this, a Profile Field I have added disappears, and then no one is able to register. The register page just refresh.

    Any other options? MANY of the guys in here must have done something about this issue already, as it is a really important thing for any dating site.

    #10866
     Abe
    Keymaster

    Hi, Indeed that code had some issues. Please add this to sweetdate-child/functions.php

    COPY CODE
    
    
    add_filter( 'xprofile_group_fields', 'dk_bp_remove_xprofile_fullname_field', 10, 2 );
    /**
    * Removes the default BuddyPress xprofile fullname field
    *
    * @param array $fields Array with field names
    * @return array Array with filtered fields
    *
    * @author Daan Kortenbach
    */
    function dk_bp_remove_xprofile_fullname_field( $fields ){
    
    if( ! bp_is_register_page() )
    return $fields;
    
    // Remove item from array.
    foreach ($fields as $key => $value ) {
    
    	if ( $value->id == 1 ) {
    		$fields[ $key ] = array();
    
    	}
    }
    // Return the fields
    return $fields;
    }
    
    add_action( 'bp_after_signup_profile_fields', 'dk_bp_add_xprofile_fullname_field_hidden' );
    /**
    * Adds the default BuddyPress xprofile fullname field as a hidden field
    *
    * @return string
    *
    * @author Daan Kortenbach
    */
    function dk_bp_add_xprofile_fullname_field_hidden(){
    
    if( ! bp_is_register_page() )
    return;
    
    echo '<input type="hidden" name="field_1" id="field_1" value="x">';
    }
    
    
    add_action( 'bp_core_signup_user', 'dk_bp_core_signup_user' );
    /**
    * Sets the correct user values
    *
    * @param integer $user_id
    * @return void
    *
    * @author Daan Kortenbach
    */
    function dk_bp_core_signup_user( $user_id ) {
    
    // Get user data
    $user = get_userdata( $user_id );
    
    // Update xprofile fullname
    xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $user->user_login );
    
    // Set new user data
    $userdata = array(
    'ID' => $user_id,
    'user_nicename' => $user->user_login,
    'display_name' => $user->user_login,
    'nickname' => $user->user_login
    );
    
    // Update user
    wp_update_user( $userdata );
    }
    

    and this css to Sweetdate – Styling options – Quick css

    COPY CODE
    
    #field-visibility-settings-toggle-, #field-visibility-settings- {
        display: none;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #12095
     rudik2
    Participant

    Abe i pasted this code from sweetdate-child/functions.php and Sweetdate – Styling options – Quick css but nothing has changed, still displays the name.

    #12393
     Abe
    Keymaster

    make sure you have the child theme active and you have copied all code and haven’t missed a letter or something

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #14286
     metalmick
    Participant

    Copied first script fine but can’t find “css to Sweetdate – Styling options – Quick css” on my ftp.

    Will this definately remove the @username tab? It’s driving me nuts!

    Please advise.

    #14326
     Abe
    Keymaster

    Sweetdate – Styling options – Quick css it is not on your FTP, it is in your WordPress admin

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #14327
     metalmick
    Participant

    I did try that. Went to Appearance/editor/sweetdate but no “Styling options – Quick css” in the long list there. Am I in the right place?

    #14372
     Abe
    Keymaster

    🙂 I haven’t said Appearance/editor/sweetdate, I said Sweetdate – Styling options – Quick css. Meaning that Sweetdate is a menu just like Appearance is

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #14379
     metalmick
    Participant

    Ok got it… thanks for your patience! 🙂

    I entered both exactly as you’ve shown but the @ username is still there and the functions.php script is appearing on view at the top of the website page. Am I missing brackets or something? As I said I copied the script exactly as it is.
    Thanks.

    #14452
     metalmick
    Participant

    Both codes entered as you suggest but still have @ username on profile page. 🙁

    #14674
     Abe
    Keymaster

    metalmick, I don’t know if you saw but this topic is not for that. It is for the register page 😉

    Will be closing this topic since I gave you the answer for your @ username question in another topic you replied

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘How to get remove full name and instead use username’ is closed to new replies.

Log in with your credentials

Forgot your details?